Cirq v0.4.0
Themes:
- Making the API more pythonic and more consistent (a.k.a. breaking changes and refactoring)
- Faster simulation
Notable new functionality:
cirq.Rx,cirq.Ry, andcirq.Rzcirq.XX,cirq.YY,cirq.ZZ, andcirq.MS(Mølmer–Sørensen gate)cirq.Simulatorcirq.SupportsApplyUnitaryprotocol for specifying fast simulation methodscirq.Circuit.reachable_frontier_fromandcirq.Circuit.findall_operations_betweencirq.decomposesorted(qubits)is now equivalent tocirq.QubitOrder.DEFAULT.order_for(qubits)cirq.experiments.generate_supremacy_circuit_[...]dtypeparameters to control precision-vs-speed of simulationscirq.TrialResulthelper methods (dirac_notation/bloch_vector/density_matrix)cirq.TOFFOLIandcirq.CCZcan now be raised to powers
Notable breaking changes:
- Most gate classes have been standardized to take an
exponentargument and have a name of the formNamePowGate. For example,RotXGateis nowXPowGateand no longer takes rads, degs, or half_turns. - The xmon gate set has been merged into the common gate set.
- Capability marker classes have been replaced by magic method protocols. For example, gates now just implement a
_unitary_method instead of inheriting fromKnownMatrix. cirq.Extensionsandcirq.PotentialImplementationare gone.- Several decomposition classes and methods have been moved from
cirq.google.*tocirq.*. For example,cirq.google.EjectFullWis nowcirq.EjectPhasedPaulis. - Moved classes and methods related to line placement into
cirq.google.
Notable bug fixes:
- Two qubit gate decomposition no longer produces a glut of single qubit gates.
- Circuit diagrams stay aligned when given multi-line entries, and now include "same moment" indicators.
- Fixed false-positives and false-negatives in
cirq.testing.assert_circuits_with_terminal_measurements_are_equivalent. - Fixed many
reprmethods returning code that assumedfrom cirq import *instead ofimport cirq. - Example code now runs in both python 2 and python 3 without transpilation.
Notable dev changes:
- Test files now
import cirqinstead of specific modules. - Better testing and packaging scripts.
- No longer using different package versions for python 2 and python 3
cirq.value_equalitydecorator.- New
cirq.testingmethods and classes.
Additions to contrib:
cirq.contrib.acquaintance: utilities for defining permutation gatescirq.contrib.paulistring: utilities for optimizing non-Clifford operations separated by Clifford operationscirq.contrib.tpu: utilities for converting circuits into a form executable on cloud TPUs (requirestensorflow)