We're celebrating World Quantum Day 2022! Join us

Module: cirq.value

Value conversion utilities and classes for time and quantum states.


abc_alt module: A more flexible abstract base class metaclass ABCMetaImplementAnyOneOf.

angle module

classical_data module

condition module

digits module

duration module: A typed time delta that supports picosecond accuracy.

linear_dict module: Linear combination represented as mapping of things to coefficients.

measurement_key module

periodic_value module

probability module: Utilities for handling probabilities.

product_state module

random_state module

timestamp module: A typed location in time that supports picosecond accuracy.

type_alias module

value_equality_attr module: Defines @cirq.value_equality, for easy eq/hash methods.


class ABCMetaImplementAnyOneOf: A metaclass extending abc.ABCMeta for defining abstract base classes

class ClassicalDataDictionaryStore: Classical data representing measurements and metadata.

class ClassicalDataStore: Helper class that provides a standard way to create an ABC using

class ClassicalDataStoreReader: Helper class that provides a standard way to create an ABC using

class Condition: A classical control condition that can gate an operation.

class Duration: A time delta that supports symbols and picosecond accuracy.

class GenericMetaImplementAnyOneOf: Generic version of ABCMetaImplementAnyOneOf.

class KeyCondition: A classical control condition based on a single measurement key.

class LinearDict: Represents linear combination of things.

class MeasurementKey: A class representing a Measurement Key.

class MeasurementType: An enumeration.

class PeriodicValue: Wrapper for periodic numerical values.

class ProductState: A quantum state that is a tensor product of one qubit states.

class SympyCondition: A classical control condition based on a sympy expression.

class Timestamp: A location in time with picosecond accuracy.


KET_IMAG(...): The |i⟩ State

KET_MINUS(...): The |-⟩ State

KET_MINUS_IMAG(...): The |-i⟩ State

KET_ONE(...): The |1⟩ State

KET_PLUS(...): The |+⟩ State

KET_ZERO(...): The |0⟩ State

alternative(...): A decorator indicating an abstract method with an alternative default

big_endian_bits_to_int(...): Returns the big-endian integer specified by the given bits.

big_endian_digits_to_int(...): Returns the big-endian integer specified by the given digits and base.

big_endian_int_to_bits(...): Returns the big-endian bits of an integer.

big_endian_int_to_digits(...): Separates an integer into big-endian digits.

canonicalize_half_turns(...): Wraps the input into the range (-1, +1].

chosen_angle_to_canonical_half_turns(...): Returns a canonicalized half_turns based on the given arguments.

chosen_angle_to_half_turns(...): Returns a half_turns value based on the given arguments.

parse_random_state(...): Interpret an object as a pseudorandom number generator.


validate_probability(...): Validates that a probability is between 0 and 1 inclusively.

value_equality(...): Implements eq/ne/hash via a _value_equalityvalues method.

Type Aliases





PAULI_STATES [cirq.X.basis[+1], cirq.X.basis[-1], cirq.Y.basis[+1], cirq.Y.basis[-1], cirq.Z.basis[+1], cirq.Z.basis[-1]]

All one-qubit states stabalized by the pauli operators.