qat.pylinalg.simulator.reset

qat.pylinalg.simulator.reset(state_vec, qubits)

Resets the value of the specified qubits to 0.

It works by measuring each qubit, and then applying an X gate if the result is 1.

for one qubit, entirely equivalent to, in AQASM:

MEAS q[k] c[k]
?c[k] : X q[k]
Parameters
  • state_vec (numpy.ndarray) – nd-array containing the full state vector.

  • qubits (list) – list of integers, containing the qubits to reset.

Returns

a tuple composed of:
  • state_vec(numpy.ndarray) the full state vector. the specified qubits have been reset.

  • an integer: result of the measurement on the subset of qubits (when converted to binary representation, it needs to have a width of len(qubits)).

  • a float: probability the measurement had to occur.

Return type

(state_vec, int, prob)