This page describes naming rules and conventions that exist throughout Cirq. These rules are important in order to maintain a consistent interface that is easy to use. By using consistent naming, we can reduce cognitive load on users and developers. Please try to use these terms when writing code.
If you have suggestions for improvements or changes, please create a PR to modify this list or open an issue.
Quantum computing terms
state_vectorto describe a pure state. Do not use
statefor this object (
stateis too overloaded).
- If the object is an array or possibly a computational basis state
(given by an
state_repor, if it is the initial state of a system
- A function argument (
initial_state) should permit any of the possible representations of a state: A numpy array, a numpy tensor, an integer representing a qubit-system's computational basis state, a sequence of n integers representing a qudit's basis state, or a
cirq.ProductState. The type annotation should be
cirq.STATE_VECTOR_LIKEand you should use
cirq.to_valid_state_vectorto canonicalize as a numpy array of amplitudes. If a function expects a numpy array of amplitudes, its type annotation should be
density_matrixto describe a mixed state that is passed in as a numpy matrix or numpy tensor. Do not used