Add checks in INITIALIZE-INSTANCE to validate the NOISY-GATE-DEFINITIONS and READOUT-POVMS slots for NOISY-QVMs and DENSITY-QVMs, and also for the SUPEROPERATOR-DEFINITIONS slot of BASE-QVMs.
I've attempted to keep the changes here minimal in order to reduce the risk of introducing more bugs in case we want to try and squeeze these changes in for the 2.15.x forest release, and also because I'm still uncertain how all the pieces fit together.
Open questions + things that could potentially be done in this PR, or else in a follow on:
Remove the call to check-kraus-ops in convert-to-kraus-list and thereby avoid paying that penalty on every transition involving a noisy gate. However, why not go one step further and just store the superoperators directly, and avoid the call to convert-to-kraus-list as well? I think this would be possible for noisy-qvm, but I am still not sure about channel-qvm or basic-noise-qvm...
The base-qvm class has a superoperator-definitions slot. Why don't noisy-qvm and density-qvm use that rather than their noisy-gate-definitions slots?
Why does noisy-qvm require a static gate, but density-qvm is happy to deal with parameters?
Changes in this PR include
Add checks in
INITIALIZE-INSTANCE
to validate theNOISY-GATE-DEFINITIONS
andREADOUT-POVMS
slots forNOISY-QVM
s andDENSITY-QVM
s, and also for theSUPEROPERATOR-DEFINITIONS
slot ofBASE-QVM
s.Ensure
DENSITY-QVM
'sTRANSITION
method respectsNOISY-GATE-DEFINITIONS
a handful of other small cleanups
I've attempted to keep the changes here minimal in order to reduce the risk of introducing more bugs in case we want to try and squeeze these changes in for the 2.15.x forest release, and also because I'm still uncertain how all the pieces fit together.
Open questions + things that could potentially be done in this PR, or else in a follow on:
Remove the call to
check-kraus-ops
inconvert-to-kraus-list
and thereby avoid paying that penalty on everytransition
involving a noisy gate. However, why not go one step further and just store thesuperoperator
s directly, and avoid the call toconvert-to-kraus-list
as well? I think this would be possible fornoisy-qvm
, but I am still not sure aboutchannel-qvm
orbasic-noise-qvm
...The
base-qvm
class has asuperoperator-definitions
slot. Why don'tnoisy-qvm
anddensity-qvm
use that rather than theirnoisy-gate-definitions
slots?Why does
noisy-qvm
require a static gate, butdensity-qvm
is happy to deal with parameters?Maybe moar tests