quil-lang / qvm

The high-performance and featureful Quil simulator.
Other
411 stars 57 forks source link

changing the default :initarg of channel-qvm to be valid #211

Closed sophiaponte closed 4 years ago

sophiaponte commented 4 years ago

210

The channel-qvm expects its :noise-model slot to be a noise-model object, but it's default initarg is nil. This causes errors when a channel-qvm is created without a defined noise-model argument. To fix this I:

rigettizach commented 4 years ago

changed the default noise-model initarg of channel-qvm to be a noise-model with an empty set of noise-rules

Is there any risk this could trip up someone who meant to provide a non-empty noise model but forgot?

sophiaponte commented 4 years ago

Is there any risk this could trip up someone who meant to provide a non-empty noise model but forgot?

Yes, I suppose if someone forgot to provide a noise model, the channel-qvm would run with the default empty noise model as if there were no noise.

So I guess an alternative option is to make the noise model a required argument to the qvm -- that way, the noise model will only be empty if the user explicitly wants it so.