I am working on designing quantum error mitigation algorithms for simulating chemical systems. Therefore, a necessary component is to add noisy to the ideal circuit when using a quantum simulator. But I notice there is no such features in the official documentation of openfermion. Is there a way to add noise to the circuit in openfermion?


Note that OpenFermion interoperates with cirq to provide many features that are not specific to quantum chemistry. You can add noise to your circuits like this

noisy = ideal.with_noise(cirq.depolarize(p=0.01))

where ideal and noisy are instances of cirq.Circuit. Alternatively, you can use a simulator such as cirq.DensityMatrixSimulator which allows you to add noise to the simulation, e.g.

noise = cirq.ConstantQubitNoiseModel(cirq.depolarize(0.01))
noisy_simulator = cirq.DensityMatrixSimulator(noise=noise)

See this notebook for more details and code examples for both approaches.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.