qat.pylinalg.simulator
The actual numpy-based simulation code can be accessed in the qat.pylinalg.simulator
module, which source code is documented here.
Simulate a provided circuit |
Note
qat.pylinalg.simulator.simulate()
mainly consists in a for loop
over the ops
attribute of the input Circuit
,
i.e the gates of the circuit. They are successively applied onto the quantum
state, which starts in \(|0...0\rangle\). A gate can be of several types:
GATETYPE (default)
MEASURE (measure some qubits, store the result)
RESET (measure a qubit, if result is 1, apply X onto it)
CLASSIC (perform classical logical computation on classical bits)
CLASSICCTRL (perform classically controlled quantum gate)
BREAK (raise break exception if a clasical formula is evaluated to True)
circuit.ops
is a list of qat.comm.datamodel.ttypes.Op
.
Converts serialized matrix format into numpy array |
|
Samples measurement results on the specified qubits |
|
Projects the state to specified values |
|
Raises break exception |
|
Resets the value of the specified qubits |