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 ?
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 ?
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.
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.