![]() |
Simulator that allows access to the simulator's final state.
Implementors of this interface should implement the simulate_sweep
method. This simulator only returns the state of the quantum system
for the final step of a simulation. This simulator state may be a state
vector, the density matrix, or another representation, depending on the
implementation. For simulators that also allow stepping through
a circuit see SimulatesIntermediateState
.
Methods
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_sweep
@abc.abstractmethod
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 final simulator state. 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. |