|View source on GitHub|
Returns the density matrix resulting from simulating the circuit.
cirq.sim.final_density_matrix( program: "cirq.CIRCUIT_LIKE", *, noise: "cirq.NOISE_MODEL_LIKE" = None, initial_state: "cirq.STATE_VECTOR_LIKE" = 0, param_resolver:
cirq.study.ParamResolverOrSimilarType= None, qubit_order:
cirq.ops.QubitOrderOrList= cirq.ops.QubitOrder.DEFAULT, dtype: Type[np.number] = np.complex64, seed: Optional[Union[int, np.random.RandomState]] = None, ignore_measurement_results: bool = True ) -> "np.ndarray"
Note that, unlike
cirq.final_state_vector, terminal measurements
are not omitted. Instead, all measurements are treated as sources
of decoherence (i.e. measurements do not collapse, they dephase). See
ignore_measurement_results for details.
||The circuit, gate, operation, or tree of operations to apply to the initial state in order to produce the result.|
||Noise model to use while running the simulation.|
||Parameters to run with the program.|
||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.|
||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.|
||The random seed to use for this simulator.|
||Defaults to True. When True, the returned density matrix is not conditioned on any measurement results. For example, this effectively replaces computational basis measurement with dephasing noise. The result density matrix in this case should be unique. When False, the result will be conditioned on sampled (but unreported) measurement results. In this case the result may vary from call to call.|
|The density matrix for the state which results from applying the given operations to the desired initial state.|