ChpSim.ChpState
— TypeChpState(num_qubits[, bitpack=true])
The state of a quantum stabilizer circuit simulation. I.e. the simulated state of a quantum computer after applying only Clifford operations to qubits that all start in the |0⟩
state.
Supported operations: cnot!
, hadamard!
, phase!
, measure!
ChpSim.MeasureResult
— TypeMeasureResult(value, determined)
The result of a qubit measurement returned by measure!
.
ChpSim.cnot!
— Methodcnot!(state, control, target)
Perform a CNOT gate and update the state.
ChpSim.hadamard!
— Methodhadamard!(state, qubit)
Perform a Hadamard gate and update the state.
ChpSim.measure!
— Methodmeasure!(state, qubit; rng=GLOBAL_RNG, bias=0.5)
Perform a measurement in the Z basis and return the result. If the qubit was in superposition, pick a random result and update the state.
Arguments
qubit::Int
: The qubit index to measure.rng::AbstractRNG
: The random number generator to use.bias::Real
: The artificial probablility of measuring a 1 randomly.
ChpSim.phase!
— Methodphase!(state, qubit)
Perform a phase gate (S gate) and update the state.