# Cirq: Getting The Instances (samples) of a Quantum Circuit with Probabilistic Unitaries or Mixtures

The wavefunction simulator in Cirq uses a Monte Carlo approach to simulate a certain subset of quantum noise channels, namely through probabilistic/stochastic application of unitary gates. These are called MixedUnitaryGates, mixtures, etc. in Cirq.

Instead of creating the Kraus operators of a channel to deterministically apply to the NxN dimensional density matrix, the simulator here samples a unitary gate for given probabilities, gets a noisy circuit with all unitary operations, and apply this circuit/unitary on the initial wavefunction to acquire the final wavefunction. Given a noisy circuit, the cirq.Simulator() does exactly this way to output a final state vector. Here, each instance gives a different state vector.

I could not exactly verify Cirq's pipeline. But I need an array/list of these sampled instances of noisy circuits. Do you know if Cirq has a function to sample unitary circuits out of noisy circuits with mixtures (i.e, probabilistic unitaries)?

Let's say I want to have M=100 circuit samples from a circuit with depolarizing channel with p=0.03:

circuit=cirq.Circuit()
noisy_circuit=circuit.with_noise(cirq.depolarize(0.1))

#After calling the mystery function we sample M=100 instances of unitary circuits

sampled_circuits=MysteryFunction(noisy_circuit,M=100)



Is there a MysteryFunction of the above form? Is there a way to sample these unitary circuits out of circuits with channels that support Mixture format?

Thank you

New contributor
Onur Danaci is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.