Skip to content

Commit

Permalink
patched ApplyPauliTransferMap to handle null transitions
Browse files Browse the repository at this point in the history
as are incurred by maximally-mixing channels
  • Loading branch information
TysonRayJones committed Apr 1, 2024
1 parent 3901228 commit 3715f94
Show file tree
Hide file tree
Showing 5 changed files with 532 additions and 226 deletions.
17 changes: 10 additions & 7 deletions Link/QuESTlink.m
Original file line number Diff line number Diff line change
Expand Up @@ -3045,11 +3045,11 @@ The probability of the forced measurement outcome (as if it were hypothetically
GetCircuitGeneralised[op_] := GetCircuitGeneralised[{op}]
GetCircuitGeneralised[___] := invalidArgError[GetCircuitGeneralised]

getChannelAssumps[Subscript[Damp, _][x_]] := (0 <= x < 1)
getChannelAssumps[Subscript[Deph, _][x_]] := (0 <= x < 1/2)
getChannelAssumps[Subscript[Deph, _,_][x_]] := (0 <= x < 3/4)
getChannelAssumps[Subscript[Depol, _][x_]] := (0 <= x < 3/4)
getChannelAssumps[Subscript[Depol, _,_][x_]] := (0 <= x < 15/16)
getChannelAssumps[Subscript[Damp, _][x_]] := (0 <= x <= 1)
getChannelAssumps[Subscript[Deph, _][x_]] := (0 <= x <= 1/2)
getChannelAssumps[Subscript[Deph, _,_][x_]] := (0 <= x <= 3/4)
getChannelAssumps[Subscript[Depol, _][x_]] := (0 <= x <= 3/4)
getChannelAssumps[Subscript[Depol, _,_][x_]] := (0 <= x <= 15/16)
getChannelAssumps[_] := Nothing

shiftInds[q__Integer|{q__Integer}, numQb_] := Sequence @@ (List[q]+numQb)
Expand Down Expand Up @@ -5459,8 +5459,11 @@ variable renaming in nested scoping structs (Module[ Function[]]) *)

(* extract base-4 index of targeted inDigits *)
numQb = Length @ {q};
inInd = FromDigits[Reverse @ inDigits[[-{q}-1]], 4];

inInd = FromDigits[Reverse @ inDigits[[-{q}-1]], 4];

(* short-circuit if map produces null state (as do fully-mixing channels) *)
If[(inInd /. {rules}) === {}, Return @ {}];

MapAt[
(* which maps to a list of outInds. For each... *)
Function[{outInd},
Expand Down

0 comments on commit 3715f94

Please sign in to comment.