qat.pylinalg.simulator.project

qat.pylinalg.simulator.project(state_vec, qubits, intprob)

Projects the state by assigning qubits to specified values.

The “measure” function does not project. This is nice when asking for several samples. But the full behavior of a quantum state when undergoing measurement includes a projection onto the result state. This is what this function does. In practice, it is used for intermediary measurements. (i.e within measure and reset gates)

Parameters
  • state_vec (numpy.ndarray) – The state vector to project, i.e the one from which the results were sampled.

  • qubits (list) – The qubits that were measured, presented as a list of integers. Without this info, we don’t know to what axes the result corresponds.

  • intprob (tuple) – a tuple of the form (integer, probability). The integer codes for the value that was measured on the qubits in the list “qubits”. The probability that the measurement had to occur. It is useful for renormalizing without having to recompute a norm.

Returns

The projected state vector. The values of the qubits in the “qubits” list have been assigned to the measured values.

Return type

numpy.ndarray