0

I want to perform post-selection on IBM Qiskit and run on actual quantum computer. (What is post-selection) How can I perform it ?

Can I use qiskit.circuit.QuantumCircuit.reset for it ? How to use it ?

Chetan Waghela
  • 388
  • 1
  • 10

2 Answers2

3

Qiskit is used to have get_subsystems_counts function which takes complete_system_counts and returns the counts subject to a post selection specified using post_select_index and post_select_flag parameters.

complete_system_counts = { '10 1': 255, '11 0':320, '01 1': 449 }
result = get_subsystems_counts(complete_system_counts, 1, '1')
print(result)

However, since get_subsystems_counts is part of Qiskit Aqua, it is now deprecated. I'm not aware of any alternative, but you can get its code from here.

Egretta.Thula
  • 9,972
  • 1
  • 11
  • 30
2

Postselection isn't a gate. You can't apply it on an actual quantum computer.

What you can do is take many unpostselected samples and discard the ones that didn't meet the selection criteria.

Craig Gidney
  • 36,389
  • 1
  • 29
  • 95