pasqal-io / qadence

Digital-analog quantum programming interface
https://pasqal-io.github.io/qadence/latest/
Apache License 2.0
72 stars 21 forks source link

[FIX] Allow 0 to be passed as a config to print,write,plot,checkpoint_every and disable in that case #511

Closed awennersteen closed 3 months ago

awennersteen commented 4 months ago

This can be desired behavior in some cases, and is perhaps a better behaviour than the current where we end up raising DivideByZero errors.

We can perhaps use the __post_int__ of the TrainConfig to do more validation here (like negative values), and print a warning?

Not sure what we think is best.

awennersteen commented 3 months ago

Thanks @awennersteen. Stupid question: does it make sense to default it to 0 and only check if it is non-negative ?

I have no idea. My guess is that users usually will want these to be printed?

But yeah, I guess >0 is a better case to enable for than !=0