Skip to content

Cirq v0.4.0

Compare
Choose a tag to compare
@Strilanc Strilanc released this 30 Nov 01:47
4460134

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, and cirq.Rz
  • cirq.XX, cirq.YY, cirq.ZZ, and cirq.MS (Mølmer–Sørensen gate)
  • cirq.Simulator
  • cirq.SupportsApplyUnitary protocol for specifying fast simulation methods
  • cirq.Circuit.reachable_frontier_from and cirq.Circuit.findall_operations_between
  • cirq.decompose
  • sorted(qubits) is now equivalent to cirq.QubitOrder.DEFAULT.order_for(qubits)
  • cirq.experiments.generate_supremacy_circuit_[...]
  • dtype parameters to control precision-vs-speed of simulations
  • cirq.TrialResult helper methods (dirac_notation / bloch_vector / density_matrix)
  • cirq.TOFFOLI and cirq.CCZ can now be raised to powers

Notable breaking changes:

  • Most gate classes have been standardized to take an exponent argument and have a name of the form NamePowGate. For example, RotXGate is now XPowGate and 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 from KnownMatrix.
  • cirq.Extensions and cirq.PotentialImplementation are gone.
  • Several decomposition classes and methods have been moved from cirq.google.* to cirq.*. For example,cirq.google.EjectFullW is now cirq.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 repr methods returning code that assumed from cirq import * instead of import cirq.
  • Example code now runs in both python 2 and python 3 without transpilation.

Notable dev changes:

  • Test files now import cirq instead of specific modules.
  • Better testing and packaging scripts.
  • No longer using different package versions for python 2 and python 3
  • cirq.value_equality decorator.
  • New cirq.testing methods and classes.

Additions to contrib:

  • cirq.contrib.acquaintance: utilities for defining permutation gates
  • cirq.contrib.paulistring: utilities for optimizing non-Clifford operations separated by Clifford operations
  • cirq.contrib.tpu: utilities for converting circuits into a form executable on cloud TPUs (requires tensorflow)