qsim
qsim copied to clipboard
Classical control
In order to represent quantum teleportation, error correction, and other algorithms, qsim must support classical control. There are three key parts to this feature:
- Classical registers: qsim must be able to track classical variables alongside the quantum state. These integer variables include measurement output (added in #141), user-specified input, and calculated values.
- Classical operators: qsim must have a framework for applying arithmetic functions to classical registers and storing the result in a target register. This framework should accept user-specified functions - the operators need not be defined in qsim itself.
- Classical control: qsim must allow classical registers to control quantum gates. A "switch" operation is sufficient for this (given an input value, and a
(case, gate)mapping, apply the gate whosecasematches the input, if one exists).
xref https://github.com/quantumlib/Cirq/pull/4631, the classical control PR for Cirq.