-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
area/gatesarea/post-selectioncomplexity/mediumintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorkind/feature-requestDescribes new functionalityDescribes new functionalitytriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on
Description
As a sort of post-selection. The recent change to simulator broke this test. Not sure how to fix it given the new interface. @dabacon ideas?
result = simulator.simulate(
circuit,
qubit_order=[ancilla_qubit] + list(system_qubits),
initial_state=current_state,
repetitions=reps)
# Determine the bit by majority vote
num_ones = numpy.count_nonzero(result.measurements['ancilla_qubit'])
num_zeros = reps - num_ones
last_measured_bit = num_ones > num_zeros
# Get one of the resulting states with the correct bit measured
current_state = result.final_states[
numpy.where(result.measurements['ancilla_qubit'] ==
last_measured_bit)[0][0]]Metadata
Metadata
Assignees
Labels
area/gatesarea/post-selectioncomplexity/mediumintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorkind/feature-requestDescribes new functionalityDescribes new functionalitytriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on