qat.pylinalg.simulator.simulate

qat.pylinalg.simulator.simulate(circuit)

Computes state vector at the output of provided circuit.

State vector is stored as a numpy.ndarray It is initialized at \(|0^n\rangle\). Then, loop over gates, updating the state vector using np.tensordot

Parameters

circuit (Circuit) – Input circuit. The circuit to simulate.

Returns

a tuple composed of a state vector and intermediate measurements:
  • state vector: numpy.ndarray containing the final state vector. It has one 2-valued index per qubits.

  • intermediate measurements: list of qat.comm.shared.ttypes.IntermediateMeasurement. List containing descriptors of the intermediate measurements that occurred within the circuit, so that the classical branching is known to the user.

Return type

tuple