![]() |
Deprecated. Please use SimulatesIntermediateStateVector
instead.
Inherits From: SimulatesIntermediateStateVector
, SimulatesAmplitudes
, SimulatesIntermediateState
, SimulatesFinalState
cirq.sim.SimulatesIntermediateWaveFunction(
*args, **kwargs
)
Methods
compute_amplitudes
compute_amplitudes(
program: "cirq.Circuit",
bitstrings: Sequence[int],
param_resolver: "study.ParamResolverOrSimilarType" = None,
qubit_order: cirq.ops.QubitOrderOrList
= cirq.ops.QubitOrder.DEFAULT
) -> Sequence[complex]
Computes the desired amplitudes.
The initial state is assumed to be the all zeros state.
Args | |
---|---|
program
|
The circuit to simulate. |
bitstrings
|
The bitstrings whose amplitudes are desired, input
as an integer array where each integer is formed from measured
qubit values according to qubit_order from most to least
significant qubit, i.e. in big-endian ordering.
|
param_resolver
|
Parameters to run with the program. |
qubit_order
|
Determines the canonical ordering of the qubits. This is often used in specifying the initial state, i.e. the ordering of the computational basis states. |
Returns | |
---|---|
List of amplitudes. |
compute_amplitudes_sweep
compute_amplitudes_sweep(
program: "cirq.Circuit",
bitstrings: Sequence[int],
params: cirq.study.Sweepable
,
qubit_order: cirq.ops.QubitOrderOrList
= cirq.ops.QubitOrder.DEFAULT
) -> Sequence[Sequence[complex]]
Computes the desired amplitudes.
The initial state is assumed to be the all zeros state.
Args | |
---|---|
program
|
The circuit to simulate. |
bitstrings
|
The bitstrings whose amplitudes are desired, input
as an integer array where each integer is formed from measured
qubit values according to qubit_order from most to least
significant qubit, i.e. in big-endian ordering.
|
params
|
Parameters to run with the program. |
qubit_order
|
Determines the canonical ordering of the qubits. This is often used in specifying the initial state, i.e. the ordering of the computational basis states. |
Returns | |
---|---|
List of lists of amplitudes. The outer dimension indexes the circuit parameters and the inner dimension indexes the bitstrings. |
simulate
simulate(
program: "cirq.Circuit",
param_resolver: "study.ParamResolverOrSimilarType" = None,
qubit_order: cirq.ops.QubitOrderOrList
= cirq.ops.QubitOrder.DEFAULT,
initial_state: Any = None
) -> "SimulationTrialResult"
Simulates the supplied Circuit.
This method returns a result which allows access to the entire simulator's final state.
Args | |
---|---|
program
|
The circuit to simulate. |
param_resolver
|
Parameters to run with the program. |
qubit_order
|
Determines the canonical ordering of the qubits. This is often used in specifying the initial state, i.e. the ordering of the computational basis states. |
initial_state
|
The initial state for the simulation. The form of this state depends on the simulation implementation. See documentation of the implementing class for details. |
Returns | |
---|---|
SimulationTrialResults for the simulation. Includes the final state. |
simulate_moment_steps
simulate_moment_steps(
circuit: cirq.circuits.Circuit
,
param_resolver: "study.ParamResolverOrSimilarType" = None,
qubit_order: cirq.ops.QubitOrderOrList
= cirq.ops.QubitOrder.DEFAULT,
initial_state: Any = None
) -> Iterator
Returns an iterator of StepResults for each moment simulated.
If the circuit being simulated is empty, a single step result should be returned with the state being set to the initial state.
Args | |
---|---|
circuit
|
The Circuit to simulate. |
param_resolver
|
A ParamResolver for determining values of Symbols. |
qubit_order
|
Determines the canonical ordering of the qubits. This is often used in specifying the initial state, i.e. the ordering of the computational basis states. |
initial_state
|
The initial state for the simulation. The form of this state depends on the simulation implementation. See documentation of the implementing class for details. |
Returns | |
---|---|
Iterator that steps through the simulation, simulating each moment and returning a StepResult for each moment. |
simulate_sweep
simulate_sweep(
program: "cirq.Circuit",
params: cirq.study.Sweepable
,
qubit_order: cirq.ops.QubitOrderOrList
= cirq.ops.QubitOrder.DEFAULT,
initial_state: Any = None
) -> List['SimulationTrialResult']
Simulates the supplied Circuit.
This method returns a result which allows access to the entire state vector. In contrast to simulate, this allows for sweeping over different parameter values.
Args | |
---|---|
program
|
The circuit to simulate. |
params
|
Parameters to run with the program. |
qubit_order
|
Determines the canonical ordering of the qubits. This is often used in specifying the initial state, i.e. the ordering of the computational basis states. |
initial_state
|
The initial state for the simulation. The form of this state depends on the simulation implementation. See documentation of the implementing class for details. |
Returns | |
---|---|
List of SimulationTrialResults for this run, one for each possible parameter resolver. |