cirq.Simulator.simulate¶
-
Simulator.simulate(circuit: cirq.circuits.circuit.Circuit, param_resolver: cirq.study.resolver.ParamResolver = cirq.ParamResolver({}), qubit_order: Union[cirq.ops.qubit_order.QubitOrder, Iterable[cirq.ops.raw_types.QubitId]] = <cirq.ops.qubit_order.QubitOrder object>, initial_state: Union[int, numpy.ndarray] = 0) → cirq.sim.simulator.SimulationTrialResult¶ Simulates the entire supplied Circuit.
This method returns a result which allows access to the entirewave function.Parameters: - circuit – The circuit to simulate.
- param_resolver – Parameters to run with the program.
- qubit_order – Determines the canonical ordering of the qubits used to define the order of amplitudes in the wave function.
- initial_state – If an int, the state is set to the computational basis state corresponding to this state. Otherwise if this is a np.ndarray it is the full initial state. In this case it must be the correct size, be normalized (an L2 norm of 1), and be safely castable to an appropriate dtype for the simulator.
Returns: SimulateTrialResults for the simulation. Includes the final wave function.