Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

NoiseModels are not serializable

Open jarthurgross opened this issue 3 years ago • 3 comments

When running simulations, I try to serialize everything I can so I don't forget to store any details for later. Right now I have to decorate NoiseModels with my own class that supports JSON serialization in order to document the noise rates used in my simulations.

It would be great if the NoiseModels themselves supported JSON serialization.

P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle

jarthurgross avatar Feb 23 '21 16:02 jarthurgross

Thank you @jarthurgross - I think this sounds like a reasonable request!

balopat avatar Feb 23 '21 17:02 balopat

Chiming in here: noise models can contain user-defined methods for applying noise, which makes serializing these object complicated at best.

95-martin-orion avatar Mar 28 '22 20:03 95-martin-orion

Marking as after 1.0 since this will be a feature addition and won't impact existing APIs. @95-martin-orion mentioned there are alternatives for realistic noise models, and if we do decide to pursue the approach in this issue, the two JSON serializations can coexist.

verult avatar Mar 28 '22 20:03 verult