Add two methods measure and collapse in acqdp.circuit.Circuit.
The method measure of a circuit takes an argument specifying the index of the qubit to be measured, and returns a random measurement result and the corresponding conditional quantum state. Two optional arguments include remove_qubit, indicating whether the qubit being measured is to be removed from the system, and collapse, indicating whether the returned conditional state still preserves the tensor network structure.
The method collapse evaluates a quantum circuit as a tensor network, and replace the tensor network structure with the value of it. Doing this simplifies the quantum circuit and makes state vector update more efficient. collapse now only supports quantum circuits that are states, i.e. quantum operators with no input wires.
Add two methods
measure
andcollapse
inacqdp.circuit.Circuit
.The method
measure
of a circuit takes an argument specifying the index of the qubit to be measured, and returns a random measurement result and the corresponding conditional quantum state. Two optional arguments includeremove_qubit
, indicating whether the qubit being measured is to be removed from the system, andcollapse
, indicating whether the returned conditional state still preserves the tensor network structure.The method
collapse
evaluates a quantum circuit as a tensor network, and replace the tensor network structure with the value of it. Doing this simplifies the quantum circuit and makes state vector update more efficient.collapse
now only supports quantum circuits that are states, i.e. quantum operators with no input wires.