This release re-exposes some Monte Carlo sampling functions previously hidden (due to insufficient testing), extends the AssertValidChannels
option to gates, and generally improves validation. It also patches a critical bug in SimplifyPaulis[]
, as elaborated upon below - please read on!
New features
-
GetCircuitsFromChannel[]
(added privately inv0.12
2022) analytically decomposes a channel or noisy circuit into a list of pure circuits, each compatible with state-vector simulation, and which together constitute the circuit's possible errors. -
GetRandomCircuitFromChannel[]
(ofv0.12
) randomly returns one of the channel's decomposed pure circuits (like above), weighted by its classical probability. -
SampleExpecPauliString[]
estimates a noisy expectation value through Monte Carlo sampling of statevector simulation, avoiding quadratically more expensive density-matrix simulation. -
GetCircuitConjugated[]
returns a circuit with a Z-basis matrix equal to the complex conjugate of that of the given circuit. -
GetPauliString[]
can now simultaneously accept specification of both the target qubits, and the number of final Paulis to keep in the string (padding withId
). This enables users to (e.g.) specify an8x8
matrix encoding the Paulis upon qubits{2,4,7}
, and further request that the output string acts upon5
qubits. -
Option
AssertValidChannels -> False
to functions likeCalcCircuitMatrix[]
now further relaxes the assumption that the operator parameters (like rotation strength) are real. This is necessary for obtaining the correct results from functions likeGetCircuitSuperoperator[]
andCalcPauliTransferMatrix[]
when you wish to permit all symbols to be completely general.
Changes
-
improved the validation of
SimplifyPaulis[]
so that it explicitly reports an error when encountering an non-simplifiable sub-expression, forbidding the expression to commute. -
improved the validation of
DrawPauliTransferMap[]
which now warns when the given map includes an un-rendered null transition (i.e. the map produces nothing from one or more Pauli states). -
improved the node-labelling of
DrawPauliTransferMap[]
when given option"PauliStringForm" -> "String"
or"Kronecker"
. Previously, node labels were agnostic to the particular target qubits of the operator, indicating only the "internal, relative" states of the map; this was concise but confusing. Nodes are now labelled as explicit, full Pauli strings:
Bug fixes
-
patched a catastrophic error in
SimplifyPaulis[]
whereby multiplication of same-target operatorsX*Z
andZ*X
produced an incorrect sign. A warning of this bug is temporarily reported when callingImport["...questlink.m"]
-
patched a bug where passing symbolic constants (e.g.
Pi
,Sqrt[2]
,Rational[1,10]
) as coefficients of Pauli operators to backend Pauli string functions (likeCalcExpecPauliString[]
) caused the QuESTlink process to crash. The following functions now permit symbolic constants, provided they are later evaluable as floating-point numbers:CalcExpecPauliStringDerivs[]
SetQuregToPauliString[]
CalcExpecPauliString[]
ApplyPauliString[]
CalcPauliStringMatrix[]
SampleExpecPauliString[]
-
patched
ApplyPauliTransferMap[]
to support null-transition maps, as can result from maximally-mixing channels (e.g.Damp[prob=1]
) -
patched
ApplyPauliTransferMap[]
when given numerical operator parameters, which was previously vulnerable to throwing an unexpected input-validation error. -
patched
SimplifyPaulis[]
validation which previously correctly displayed an error message when given bad input, but returnedNull
instead of$Failed
. -
fixed a typo in the real-time simulation demo. Thanks to the hawk-eyed @GibbsJR !