Module: cirq.sim

Base simulation classes and generic simulators.

Modules

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.

simulator module: Abstract base classes for different types of 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 ActOnCliffordTableauArgs: State and context for an operation acting on a clifford tableau.

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 CliffordTableau: Tableau representation of a stabilizer state

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 SimulatesAmplitudes: Simulator that computes final amplitudes of given bitstrings.

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 SimulatesIntermediateWaveFunction: Deprecated. Please use SimulatesIntermediateStateVector instead.

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 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: Results of a step of a SimulatesIntermediateState.

class StateVectorTrialResult: A SimulationTrialResult that includes the StateVectorMixin methods.

class StepResult: Results of a step of a SimulatesIntermediateState.

class WaveFunctionSimulatorState: Deprecated. Please use StateVectorSimulatorState instead.

class WaveFunctionStepResult: Deprecated. Please use StateVectorStepResult instead.

class WaveFunctionTrialResult: Deprecated. Please use StateVectorTrialResult instead.

Functions

bloch_vector_from_state_vector(...): THIS FUNCTION IS DEPRECATED.

density_matrix_from_state_vector(...): THIS FUNCTION IS DEPRECATED.

dirac_notation(...): THIS FUNCTION IS DEPRECATED.

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.

final_wavefunction(...): THIS FUNCTION IS DEPRECATED.

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.

to_valid_density_matrix(...): THIS FUNCTION IS DEPRECATED.

to_valid_state_vector(...): THIS FUNCTION IS DEPRECATED.

validate_normalized_state(...): THIS FUNCTION IS DEPRECATED.

von_neumann_entropy(...): THIS FUNCTION IS DEPRECATED.

Type Aliases

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

STATE_VECTOR_LIKE: The central part of internal API.

deprecated_constants