Module: cirq_google

Classes for working with Google's Quantum Engine API.

Modules

api module: Helpers for converting to/from api data formats.

calibration module

devices module

engine module: Client for running on Google's Quantum Engine.

experimental module: Experimental features. Their API can be broken without any warning and might be in an work-in

json_resolver_cache module

line module

ops module

optimizers module: Package for optimizers and gate compilers related to Google-specific devices.

serialization module: Classes for serializing circuits into protocol buffers.

workflow module

Classes

class AnnealSequenceSearchStrategy: Linearized sequence search using simulated annealing method.

class BitstringsMeasurement: Use in-circuit MeasurementGate to collect many repetitions of strings of bits.

class Calibration: A convenience wrapper for calibrations that acts like a dictionary.

class CalibrationLayer: Python implementation of the proto found in

class CalibrationResult: Python implementation of the proto found in

class CalibrationTag: Tag to add onto an Operation that specifies alternate parameters.

class CircuitOpDeserializer: Describes how to serialize CircuitOperations.

class CircuitOpSerializer: Describes how to serialize CircuitOperations.

class CircuitSerializer: A class for serializing and deserializing programs and operations.

class CircuitWithCalibration: Circuit with characterization data annotations.

class ConvertToSqrtIswapGates: Attempts to convert gates into ISWAP**-0.5 gates.

class ConvertToSycamoreGates: Attempts to convert non-native gates into SycamoreGates.

class ConvertToXmonGates: Attempts to convert strange gates into XmonGates.

class DeserializingArg: Specification of the arguments to deserialize an argument to a gate.

class Engine: Runs programs via the Quantum Engine API.

class EngineJob: A job created via the Quantum Engine API.

class EngineProcessor: A processor available via the Quantum Engine API.

class EngineProgram: A program created via the Quantum Engine API.

class EngineTimeSlot: A python wrapping of a Quantum Engine timeslot.

class ExecutableResult: Results for a cg.QuantumExecutable.

class ExecutableSpec: Specification metadata about an executable.

class FSimPhaseCorrections: Operations that compensate for zeta, chi and gamma angles of an approximate FSimGate gate.

class FloquetPhasedFSimCalibrationOptions: Options specific to Floquet PhasedFSimCalibration.

class FloquetPhasedFSimCalibrationRequest: PhasedFSim characterization request specific to Floquet calibration.

class GateOpDeserializer: Describes how to deserialize a proto to a given Gate type.

class GateOpSerializer: Describes how to serialize a GateOperation for a given Gate type.

class GateTabulation: A 2-qubit gate compiler based on precomputing/tabulating gate products.

class GreedySequenceSearchStrategy: Greedy search method for linear sequence of qubits on a chip.

class KeyValueExecutableSpec: A generic executable spec whose metadata is a list of key-value pairs.

class LinePlacementStrategy: Choice and options for the line placement calculation method.

class LocalXEBPhasedFSimCalibrationOptions: Options for configuring a PhasedFSim calibration using a local version of XEB.

class LocalXEBPhasedFSimCalibrationRequest: PhasedFSim characterization request for local cross entropy benchmarking (XEB) calibration.

class PhasedFSimCalibrationError: Error that indicates the calibration failure.

class PhasedFSimCalibrationOptions: Base class for calibration-specific options passed together with the requests.

class PhasedFSimCalibrationRequest: Description of the request to characterize PhasedFSimGate.

class PhasedFSimCalibrationResult: The PhasedFSimGate characterization result.

class PhasedFSimCharacterization: Holder for the unitary angles of the cirq.PhasedFSimGate.

class PhasedFSimEngineSimulator: Wrapper on top of cirq.Simulator that allows to simulate calibration requests.

class PhysicalZTag: Class to add as a tag onto an Operation to denote a Physical Z operation.

class ProtoVersion: Protocol buffer version to use for requests to the quantum engine.

class QuantumEngineSampler: A sampler that samples from processors managed by the Quantum Engine.

class QuantumExecutable: An executable quantum program.

class QuantumExecutableGroup: A collection of QuantumExecutables.

class RuntimeInfo: Runtime information relevant to a particular cg.QuantumExecutable.

class SerializableDevice: Device object generated from a device specification proto.

class SerializableGateSet: A class for serializing and deserializing programs and operations.

class Serializer: Interface for serialization.

class SerializingArg: Specification of the arguments for a Gate and its serialization.

class SharedRuntimeInfo: Runtime information common to all cg.QuantumExecutables in an execution of a

class SycamoreGate: The Sycamore gate is a two-qubit gate equivalent to FSimGate(π/2, π/6).

class XEBPhasedFSimCalibrationOptions: Options for configuring a PhasedFSim calibration using XEB.

class XEBPhasedFSimCalibrationRequest: PhasedFSim characterization request for cross entropy benchmarking (XEB) calibration.

class XmonDevice: A device with qubits placed in a grid. Neighboring qubits can interact.

Functions

SYC(...): The Sycamore gate is a two-qubit gate equivalent to FSimGate(π/2, π/6).

arg_from_proto(...): Extracts a python value from an argument value proto.

get_engine(...): Get an Engine instance assuming some sensible defaults.

get_engine_calibration(...): Returns calibration metrics for a given processor.

get_engine_device(...): Returns a Device object for a given processor.

get_engine_sampler(...): Get an EngineSampler assuming some sensible defaults.

line_on_device(...): Searches for linear sequence of qubits on device.

make_zeta_chi_gamma_compensation_for_moments(...): Compensates circuit moments against errors in zeta, chi and gamma angles.

make_zeta_chi_gamma_compensation_for_operations(...): Compensates circuit operations against errors in zeta, chi and gamma angles.

merge_matching_results(...): Merges a collection of results into a single result.

optimized_for_sycamore(...): Optimizes a circuit for Google devices.

optimized_for_xmon(...)

prepare_characterization_for_moment(...): Describes a given moment in terms of a characterization request.

prepare_characterization_for_moments(...): Extracts a minimal set of characterization requests necessary to characterize given circuit.

prepare_characterization_for_operations(...): Extracts a minimal set of characterization requests necessary to characterize all the

prepare_floquet_characterization_for_moment(...): Describes a given moment in terms of a Floquet characterization request.

prepare_floquet_characterization_for_moments(...): Extracts a minimal set of Floquet characterization requests necessary to characterize given

prepare_floquet_characterization_for_operations(...): Extracts a minimal set of Floquet characterization requests necessary to characterize all the

run_calibrations(...): Runs calibration requests on the Engine.

run_floquet_characterization_for_moments(...): Extracts moments within a circuit to characterize and characterizes them against engine.

run_zeta_chi_gamma_compensation_for_moments(...): Compensates circuit against errors in zeta, chi and gamma angles by running calibrations on

try_convert_sqrt_iswap_to_fsim(...): Converts an equivalent gate to FSimGate(theta=π/4, phi=0) if possible.

ALL_ANGLES_FLOQUET_PHASED_FSIM_CHARACTERIZATION Instance of cirq_google.calibration.FloquetPhasedFSimCalibrationOptions
Bristlecone Instance of cirq_google.devices.known_devices._NamedConstantXmonDevice

72 xmon qubit device.

Qubit grid:

                                             (0, 5)────(0, 6)
                                             │         │
                                             │         │
                                    (1, 4)───(1, 5)────(1, 6)────(1, 7)
                                    │        │         │         │
                                    │        │         │         │
                           (2, 3)───(2, 4)───(2, 5)────(2, 6)────(2, 7)───(2, 8)
                           │        │        │         │         │        │
                           │        │        │         │         │        │
                  (3, 2)───(3, 3)───(3, 4)───(3, 5)────(3, 6)────(3, 7)───(3, 8)───(3, 9)
                  │        │        │        │         │         │        │        │
                  │        │        │        │         │         │        │        │
         (4, 1)───(4, 2)───(4, 3)───(4, 4)───(4, 5)────(4, 6)────(4, 7)───(4, 8)───(4, 9)───(4, 10)
         │        │        │        │        │         │         │        │        │        │
         │        │        │        │        │         │         │        │        │        │
(5, 0)───(5, 1)───(5, 2)───(5, 3)───(5, 4)───(5, 5)────(5, 6)────(5, 7)───(5, 8)───(5, 9)───(5, 10)───(5, 11)
         │        │        │        │        │         │         │        │        │        │
         │        │        │        │        │         │         │        │        │        │
         (6, 1)───(6, 2)───(6, 3)───(6, 4)───(6, 5)────(6, 6)────(6, 7)───(6, 8)───(6, 9)───(6, 10)
                  │        │        │        │         │         │        │        │
                  │        │        │        │         │         │        │        │
                  (7, 2)───(7, 3)───(7, 4)───(7, 5)────(7, 6)────(7, 7)───(7, 8)───(7, 9)
                           │        │        │         │         │        │
                           │        │        │         │         │        │
                           (8, 3)───(8, 4)───(8, 5)────(8, 6)────(8, 7)───(8, 8)
                                    │        │         │         │
                                    │        │         │         │
                                    (9, 4)───(9, 5)────(9, 6)────(9, 7)
                                             │         │
                                             │         │
                                             (10, 5)───(10, 6)

FSIM_GATESET Instance of cirq_google.serialization.SerializableGateSet

Gate set that combines sqrt(iswap) and syc as one fsim id.

Foxtail Instance of cirq_google.devices.known_devices._NamedConstantXmonDevice

72 xmon qubit device.

Qubit grid:

(0, 0)───(0, 1)───(0, 2)───(0, 3)───(0, 4)───(0, 5)───(0, 6)───(0, 7)───(0, 8)───(0, 9)───(0, 10)
│        │        │        │        │        │        │        │        │        │        │
│        │        │        │        │        │        │        │        │        │        │
(1, 0)───(1, 1)───(1, 2)───(1, 3)───(1, 4)───(1, 5)───(1, 6)───(1, 7)───(1, 8)───(1, 9)───(1, 10)

NAMED_GATESETS

{
 'fsim': <cirq_google.serialization.serializable_gate_set.SerializableGateSet object at 0x7f167c03bf50>,
 'sqrt_iswap': <cirq_google.serialization.serializable_gate_set.SerializableGateSet object at 0x7f167c03bf10>,
 'sycamore': <cirq_google.serialization.serializable_gate_set.SerializableGateSet object at 0x7f167c03bed0>
}

A convenience mapping from gateset names to gatesets

SQRT_ISWAP_GATESET Instance of cirq_google.serialization.SerializableGateSet

Gate set with sqrt(iswap) as the core 2 qubit interaction.

SQRT_ISWAP_INV_PARAMETERS Instance of cirq_google.calibration.PhasedFSimCharacterization
SYC_GATESET Instance of cirq_google.serialization.SerializableGateSet

Gate set with fsim(pi/2, pi/6) as the core 2 qubit interaction.

Sycamore Instance of cirq_google.devices.SerializableDevice
Sycamore23 Instance of cirq_google.devices.SerializableDevice
THETA_ZETA_GAMMA_FLOQUET_PHASED_FSIM_CHARACTERIZATION Instance of cirq_google.calibration.FloquetPhasedFSimCalibrationOptions
WITHOUT_CHI_FLOQUET_PHASED_FSIM_CHARACTERIZATION Instance of cirq_google.calibration.FloquetPhasedFSimCalibrationOptions
XMON Instance of cirq_google.serialization.SerializableGateSet

Gate set for XMON devices.