Module: cirq.sim

Base simulation classes and generic simulators.

Modules

act_on_args module: Objects and methods for acting efficiently on a state tensor.

act_on_args_container module

act_on_density_matrix_args module: Objects and methods for acting efficiently on a density matrix.

act_on_state_vector_args module: Objects and methods for acting efficiently on a state vector.

clifford module

density_matrix_simulator module: Simulator for density matrices that simulates noisy quantum circuits.

density_matrix_utils module: Code to handle density matrices.

mux module: Sampling/simulation methods that delegate to appropriate simulators.

operation_target module: An interface for quantum states as targets for operations.

simulator module: Abstract base classes for different types of simulators.

simulator_base module: Batteries-included class for Cirq's built-in simulators.

sparse_simulator module: A simulator that uses numpy's einsum for sparse matrix operations.

state_vector module: Helpers for handling quantum state vectors.

state_vector_simulator module: Abstract classes for simulations which keep track of state vector.

Classes

class ActOnArgs: State and context for an operation acting on a state tensor.

class ActOnArgsContainer: A container for a Qid-to-ActOnArgs dictionary.

class ActOnCliffordTableauArgs: State and context for an operation acting on a clifford tableau.

class ActOnDensityMatrixArgs: State and context for an operation acting on a density matrix.

class ActOnStabilizerCHFormArgs: Wrapper around a stabilizer state in CH form for the act_on protocol.

class ActOnStateVectorArgs: State and context for an operation acting on a state vector.

class CliffordSimulator: An efficient simulator for Clifford circuits.

class CliffordSimulatorStepResult: A StepResult that includes StateVectorMixin methods.

class CliffordState: A state of the Clifford simulation.

class CliffordTrialResult: Results of a simulation by a SimulatesFinalState.

class DensityMatrixSimulator: A simulator for density matrices and noisy quantum circuits.

class DensityMatrixSimulatorState: The simulator state for DensityMatrixSimulator

class DensityMatrixStepResult: A single step in the simulation of the DensityMatrixSimulator.

class DensityMatrixTrialResult: A SimulationTrialResult for DensityMatrixSimulator runs.

class OperationTarget: An interface for quantum states as targets for operations.

class SimulatesAmplitudes: Simulator that computes final amplitudes of given bitstrings.

class SimulatesExpectationValues: Simulator that computes exact expectation values of observables.

class SimulatesFinalState: Simulator that allows access to the simulator's final state.

class SimulatesIntermediateState: A SimulatesFinalState that simulates a circuit by moments.

class SimulatesIntermediateStateVector: A simulator that accesses its state vector as it does its simulation.

class SimulatesSamples: Simulator that mimics running on quantum hardware.

class SimulationTrialResult: Results of a simulation by a SimulatesFinalState.

class Simulator: A sparse matrix state vector simulator that uses numpy.

class SimulatorBase: A base class for the built-in simulators.

class SparseSimulatorStep: A StepResult that includes StateVectorMixin methods.

class StabilizerSampler: An efficient sampler for stabilizer circuits.

class StabilizerStateChForm: A representation of stabilizer states using the CH form,

class StateVectorMixin: A mixin that provide methods for objects that have a state vector.

class StateVectorSimulatorState

class StateVectorStepResult: A base class for step results.

class StateVectorTrialResult: A SimulationTrialResult that includes the StateVectorMixin methods.

class StepResult: Results of a step of a SimulatesIntermediateState.

class StepResultBase: A base class for step results.

Functions

final_density_matrix(...): Returns the density matrix resulting from simulating the circuit.

final_state_vector(...): Returns the state vector resulting from acting operations on a state.

measure_density_matrix(...): Performs a measurement of the density matrix in the computational basis.

measure_state_vector(...): Performs a measurement of the state in the computational basis.

sample(...): Simulates sampling from the given circuit.

sample_density_matrix(...): Samples repeatedly from measurements in the computational basis.

sample_state_vector(...): Samples repeatedly from measurements in the computational basis.

sample_sweep(...): Runs the supplied Circuit, mimicking quantum hardware.

Type Aliases

CIRCUIT_LIKE: A circuits.Circuit or a value that can be trivially converted into it:

deprecated_constants

{

}