Definitions for Probabilistic exact universal quantum circuits for transforming unitary operations
DefinitionQAlgorithms_Papers_Independent_Intake100_P12The objects the formalized statements of Probabilistic exact universal quantum circuits for transforming unitary operations (arXiv:1909.01366) are stated in. Each was checked against the paper by a blind read-back and a moderator.
taskOutputChoi: PDF p.2, Eq. (1): transport the accepted input-first Choi matrix to output-first order, preserving the unnormalized convention.taskFromOutputChoi: PDF p.2, Eq. (2): reconstruct using the accepted Choi inverse after explicitly swapping the output-first coordinates back to input-first order.gateChoi: PDF p.2: Choi matrix of a single-Kraus operation, in the chosen basis.OracleWireDimensions: PDF pp.4–6: dimensions of every physical wire; positivity is PositiveWires.PositiveWires: PDF pp.2–6: no zero-dimensional physical wires.Inputs: PDF p.4: tensor product input computational basis.Outputs: PDF p.4: tensor product output computational basis.ProcessBasis: PDF pp.5–7: the source's explicitly reordered I0,I,O,O0 basis.uniformWires: PDF p.4: homogeneous d-dimensional wires in the universal transformation tasks.slotTensor: PDF pp.4–6: Choi matrix of a tensor product of independently supplied slots.evaluateOracleSlots: PDF p.7, Eq. (16): full transpose on contracted IO factors, expanded entrywise. The same row/column indices in S and J are the effect of that transpose; no adjoint occurs.ParallelRealizes: PDF p.5: one simultaneous tensor batch with fixed CPTP encoder and decoder. Memory is first in both tensor products. Equality is on every combined slot map and every operator, rather than just the repeated-unitary inputs.DelayedRealizes: PDF pp.8–9, Eq. (32): the encoder prepares a normalized resource, before the input state exists. The decoder gets input,state in that explicit tensor order.sequentialRun: PDF p.5, Eq. (11): evaluation of k ordered oracle slots. Each fold entry contains exactly one oracle application, followed by a fixed channel E_i.SequentialRealizes: PDF p.5, Eq. (11): fixed-order sequential circuit; all memory and channels are quantified before the independent slot maps. At k=0 the oracle fold is empty.GeneralDeterministic: PDF pp.4–6: completely CP preserving general process in Choi coordinates. Positivity is precisely complete CP preservation; normalization is required on arbitrary independent slot channels, not merely equal unitary slots. Eq. (14) is deliberately not used.ProtocolClass: PDF pp.4–7: the three protocol classes are distinct.ClassRealizable: PDF pp.4–7: deterministic physical implementation in the named class. Sequential means Eq. (11), with k actual oracle calls, never General.WireLabel: PDF pp.5–6: labels for the homogeneous physical wires.wireCoordinate: PDF p.5: computational-basis coordinate on a labelled wire.replaceCoordinates: PDF p.5: replace exactly the selected coordinates by coordinates of z.traceReplace: PDF pp.5–6: trace-and-replace, R_A C = (Tr_A C) tensor I_A/d_A, in the ORIGINAL wire order. Summing over a full dummy register duplicates the unselected coordinates d^(2k+2-|A|) times; the denominator d^(2k+2) cancels that multiplicity and gives exactly the source's 1/d_A normalization.outputWires: PDF p.5: all oracle output wires plus the final external output.futureWires: PDF p.5: all wires except the external input.ParallelNormalized: PDF p.5, Eq. (10): explicit finite affine parallel normalization equations.laterWires: PDF p.5, Eq. (12): wires strictly later than slot i, plus the final output.SequentialNormalized: PDF p.5, Eq. (12): finite sequential comb normalization, in fixed slot order. The recursive partial traces are expressed as trace-and-replace in the full space.ChannelFamily: PDF pp.4–6: an actual family of independent CPTP slot-channel Choi matrices.channelAffineSpan: PDF pp.5–7: augmented span encodes the affine, rather than homogeneous, normalization constraints. Its generators are actual independent channel tuples.IsNormalizationBasis: PDF pp.5–7: finite exact normalization tests from a basis of the actual augmented independent-channel span. No assertion about a numerical rank is used.GeneralFiniteNormalized: PDF pp.4–7: finite general-process normalization on independent slot channels. Each output partial trace is an affine linear equality in C; C>=0 supplies complete CP preservation. This replaces no printed Eq. (14) by fiat.FiniteClassNormalized: PDF pp.5–7: the three explicit finite normalization systems.HeraldedRealizable: PDF pp.6–7: both CP branches are retained and normalized jointly.DelayedInstrument: PDF pp.9–10: a delayed parallel superinstrument, including its failure branch.repeatedChoi: PDF pp.6–7: identical uses of the unknown unitary channel.UnitaryTask: PDF pp.7,10,12,18: the unitary task, with channel equality removing global phases.targetChoi: PDF pp.7,10,12,18: transpose, entrywise conjugation, and inverse are different.ExactUnitarySuccess: PDF pp.6–7: exact success as an equality of unnormalized channel Choi matrices. This is equality on all inputs, including entangled references, with constant p.Attainable: PDF pp.6–7: a single physical protocol precedes the universal unknown input.DelayedAttainable: PDF pp.9,14–16: constant-success delayed-input protocols.unitarySpan: PDF p.7, Eq. (19): the actual repeated-unitary Choi span, not the ambient space.IsUnitaryBasis: PDF p.7, Eq. (19): a finite basis consisting of actual unitary operations.UnitaryLinearTarget: PDF pp.6–7, footnote 7: Section III assumes a linear channel target.TestedFeasible: PDF p.7: finitely tested SDP feasibility, with both branches and a physical class.DelayedNormalized: PDF p.9, Eq. (34): all identities are explicitly placed on I0 and O. The remaining marginal is on I, with its source normalization preserved.totalDimension: PDF p.10, Lemma 1: product of all wire dimensions, including both external wires.bellZeroKraus: PDF pp.12–13: the zero-Bell-outcome Kraus contraction, including the two normalized maximally entangled amplitudes. Its matrix entries are U_(b,a)/d.storageWires: PDF p.14, footnote 14: a storage process has no external input and a finite memory output; its k oracle slots may use any allowed causal ordering.storedProgram: PDF pp.14–16: the stored program is the memory state after all oracle uses. The input to storage is the unique scalar state on the one-dimensional wire.LearningAttainable: PDF pp.14–16 and footnote 14: exact probabilistic learning, allowing the most general storage process before the target input arrives. Its one-dimensional past and common future are fixed; this introduces no undefined delayed-input indefinite-order class. Retrieval has no oracle access, and both linear CP retrieval branches sum to a CPTP channel. Ref. [24] permits parallel storage without loss for attainable success; Lemma 3 supplies the task equivalence.switchMatrix: PDF p.17: coherent control of permutations of k slots. The controlled product acts on the system and leaves each order label untouched.parallelTransposeProbability: PDF pp.13,16: parallel transposition success; positive denominator when d,k>0.adaptiveTransposeProbability: PDF p.17: ceil(k/d) attempts, each successful with probability 1/d^2.adaptiveInverseProbability: PDF pp.18–19: floor((k+1)/d) inversion attempts.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_SchurUnitaryEnsembles
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P26
/-!
Statements from arXiv:1909.01366v2. All Choi matrices are unnormalized.
Channel indices are (output,input). Process indices are I0,I,O,O0.
The printed three-slot Eq. (14) and uncertified numerical tables are deferred.
The paper-local operational definitions below never use that equation.
Accepted matrix/channel primitives are imported; Choi adapters explicitly swap legs.
-/
noncomputable section
open QAlgorithms
open scoped Matrix ComplexConjugate ComplexOrder Kronecker
namespace QAlgorithms.Papers.Independent.Intake100.P12
attribute [local instance] Classical.propDecidable Classical.decEq
open QAlgorithms.Papers.Independent.Information100.P21 (Op)
open QAlgorithms.Papers.Independent.Dependency50.P26 (ChannelChoi)
/-- PDF p.2, Eq. (1): transport the accepted input-first Choi matrix to
output-first order, preserving the unnormalized convention. -/
def taskOutputChoi {I O : Type} [Fintype I] [DecidableEq I]
(Phi : Superop I O) : Op (O × I) :=
(QAlgorithms.Papers.Independent.Information100.P34.choi Phi).submatrix
Prod.swap Prod.swap
/-- PDF p.2, Eq. (2): reconstruct using the accepted Choi inverse after
explicitly swapping the output-first coordinates back to input-first order. -/
def taskFromOutputChoi {I O : Type} [Fintype I]
(J : Op (O × I)) : Superop I O :=
QAlgorithms.Papers.Independent.Information100.P34.fromChoi
(J.submatrix Prod.swap Prod.swap)
/-- The accepted Choi adapter puts output coordinates first without scaling. -/
example {I O : Type} [Fintype I] [DecidableEq I]
(Phi : Superop I O) (a b : O × I) :
taskOutputChoi Phi a b = Phi (Matrix.single a.2 b.2 1) a.1 b.1 := rfl
/-- Reconstruction keeps every off-diagonal input coefficient. -/
example {I O : Type} [Fintype I] (J : Op (O × I)) (X : Op I) (a b : O) :
taskFromOutputChoi J X a b = ∑ i, ∑ j, X i j * J (a,i) (b,j) := rfl
/-- PDF p.2: Choi matrix of a single-Kraus operation, in the chosen basis. -/
def gateChoi {I O : Type} (V : Matrix O I ℂ) : Op (O × I) :=
fun a b => V a.1 a.2 * conj (V b.1 b.2)
/-- PDF pp.4–6: dimensions of every physical wire; positivity is PositiveWires. -/
structure OracleWireDimensions (k : ℕ) where
inputExternal : ℕ
outputExternal : ℕ
inputSlot : Fin k → ℕ
outputSlot : Fin k → ℕ
/-- PDF pp.2–6: no zero-dimensional physical wires. -/
def PositiveWires {k : ℕ} (w : OracleWireDimensions k) : Prop :=
0 < w.inputExternal ∧ 0 < w.outputExternal ∧
(∀ i, 0 < w.inputSlot i) ∧ (∀ i, 0 < w.outputSlot i)
/-- PDF p.4: tensor product input computational basis. -/
abbrev Inputs {k : ℕ} (w : OracleWireDimensions k) := (i : Fin k) → Fin (w.inputSlot i)
/-- PDF p.4: tensor product output computational basis. -/
abbrev Outputs {k : ℕ} (w : OracleWireDimensions k) := (i : Fin k) → Fin (w.outputSlot i)
/-- PDF pp.5–7: the source's explicitly reordered I0,I,O,O0 basis. -/
abbrev ProcessBasis {k : ℕ} (w : OracleWireDimensions k) :=
Fin w.inputExternal × (Inputs w × (Outputs w × Fin w.outputExternal))
/-- PDF p.4: homogeneous d-dimensional wires in the universal transformation tasks. -/
def uniformWires (d k : ℕ) : OracleWireDimensions k := ⟨d,d,fun _ => d,fun _ => d⟩
/-- PDF pp.4–6: Choi matrix of a tensor product of independently supplied slots. -/
def slotTensor {k : ℕ} {w : OracleWireDimensions k}
(J : (i : Fin k) → Op (Fin (w.outputSlot i) × Fin (w.inputSlot i))) :
Op (Outputs w × Inputs w) :=
fun a b => ∏ i, J i (a.1 i,a.2 i) (b.1 i,b.2 i)
/-- PDF p.7, Eq. (16): full transpose on contracted IO factors, expanded entrywise.
The same row/column indices in S and J are the effect of that transpose; no adjoint occurs. -/
def evaluateOracleSlots {k : ℕ} {w : OracleWireDimensions k} (S : Op (ProcessBasis w))
(J : Op (Outputs w × Inputs w)) :
Op (Fin w.outputExternal × Fin w.inputExternal) :=
fun a b => ∑ x : Inputs w, ∑ y : Inputs w,
∑ u : Outputs w, ∑ v : Outputs w,
S (a.2,x,u,a.1) (b.2,y,v,b.1) * J (u,x) (v,y)
/-- PDF p.5: one simultaneous tensor batch with fixed CPTP encoder and decoder.
Memory is first in both tensor products. Equality is on every combined slot map
and every operator, rather than just the repeated-unitary inputs. -/
def ParallelRealizes {k : ℕ} (w : OracleWireDimensions k) (C : Op (ProcessBasis w)) : Prop :=
∃ m : ℕ, 0 < m ∧
∃ E : Superop (Fin w.inputExternal) (Fin m × Inputs w),
∃ D : Superop (Fin m × Outputs w) (Fin w.outputExternal),
IsChannel E ∧ IsChannel D ∧
∀ (J : Op (Outputs w × Inputs w)) X,
taskFromOutputChoi (evaluateOracleSlots C J) X = D (idTensorSuperop (R := Fin m) (taskFromOutputChoi J) (E X))
/-- PDF pp.8–9, Eq. (32): the encoder prepares a normalized resource, before the
input state exists. The decoder gets input,state in that explicit tensor order. -/
def DelayedRealizes {k : ℕ} (w : OracleWireDimensions k) (C : Op (ProcessBasis w)) : Prop :=
∃ m : ℕ, 0 < m ∧
∃ sigma : Op (Fin m × Inputs w), IsDensityMatrix sigma ∧
∃ D : Superop (Fin w.inputExternal × (Fin m × Outputs w)) (Fin w.outputExternal),
IsChannel D ∧ ∀ (J : Op (Outputs w × Inputs w)) X,
taskFromOutputChoi (evaluateOracleSlots C J) X =
D (X ⊗ₖ idTensorSuperop (R := Fin m) (taskFromOutputChoi J) sigma)
/-- PDF p.5, Eq. (11): evaluation of k ordered oracle slots. Each fold entry
contains exactly one oracle application, followed by a fixed channel E_i. -/
def sequentialRun {d k m : ℕ}
(E : Fin k → Superop (Fin m × Fin d) (Fin m × Fin d))
(J : Fin k → Op (Fin d × Fin d)) (X : Op (Fin m × Fin d)) :
Op (Fin m × Fin d) :=
(List.finRange k).foldl
(fun Y i => E i (idTensorSuperop (R := Fin m) (taskFromOutputChoi (J i)) Y)) X
/-- PDF p.5, Eq. (11): fixed-order sequential circuit; all memory and channels
are quantified before the independent slot maps. At k=0 the oracle fold is empty. -/
def SequentialRealizes (d k : ℕ) (C : Op (ProcessBasis (uniformWires d k))) : Prop :=
∃ m : ℕ, 0 < m ∧
∃ E0 : Superop (Fin d) (Fin m × Fin d),
∃ E : Fin k → Superop (Fin m × Fin d) (Fin m × Fin d),
∃ D : Superop (Fin m × Fin d) (Fin d),
IsChannel E0 ∧ (∀ i, IsChannel (E i)) ∧ IsChannel D ∧
∀ (J : Fin k → Op (Fin d × Fin d)) X,
taskFromOutputChoi (evaluateOracleSlots C (slotTensor (w := uniformWires d k) J)) X =
D (sequentialRun E J (E0 X))
/-- PDF pp.4–6: completely CP preserving general process in Choi coordinates.
Positivity is precisely complete CP preservation; normalization is required on
arbitrary independent slot channels, not merely equal unitary slots. Eq. (14)
is deliberately not used. -/
def GeneralDeterministic {k : ℕ} (w : OracleWireDimensions k) (C : Op (ProcessBasis w)) : Prop :=
PositiveWires w ∧ C.PosSemidef ∧
∀ J : (i : Fin k) → Op (Fin (w.outputSlot i) × Fin (w.inputSlot i)),
(∀ i, ChannelChoi (J i)) → ChannelChoi (evaluateOracleSlots C (slotTensor J))
/-- PDF pp.4–7: the three protocol classes are distinct. -/
inductive ProtocolClass where
| parallel
| adaptive
| general
deriving DecidableEq
/-- PDF pp.4–7: deterministic physical implementation in the named class.
Sequential means Eq. (11), with k actual oracle calls, never General. -/
def ClassRealizable (c : ProtocolClass) (d k : ℕ)
(C : Op (ProcessBasis (uniformWires d k))) : Prop :=
0 < d ∧ C.PosSemidef ∧ match c with
| .parallel => ParallelRealizes (uniformWires d k) C
| .adaptive => SequentialRealizes d k C
| .general => GeneralDeterministic (uniformWires d k) C
/-- PDF pp.5–6: labels for the homogeneous physical wires. -/
inductive WireLabel (k : ℕ) where
| inputExternal
| inputSlot (i : Fin k)
| outputSlot (i : Fin k)
| outputExternal
deriving DecidableEq, Fintype
/-- PDF p.5: computational-basis coordinate on a labelled wire. -/
def wireCoordinate {d k : ℕ} (x : ProcessBasis (uniformWires d k)) :
WireLabel k → Fin d
| .inputExternal => x.1
| .inputSlot i => x.2.1 i
| .outputSlot i => x.2.2.1 i
| .outputExternal => x.2.2.2
/-- PDF p.5: replace exactly the selected coordinates by coordinates of z. -/
def replaceCoordinates {d k : ℕ} (A : Finset (WireLabel k))
(x z : ProcessBasis (uniformWires d k)) : ProcessBasis (uniformWires d k) :=
(if WireLabel.inputExternal ∈ A then z.1 else x.1,
(fun i => if WireLabel.inputSlot i ∈ A then z.2.1 i else x.2.1 i),
(fun i => if WireLabel.outputSlot i ∈ A then z.2.2.1 i else x.2.2.1 i),
if WireLabel.outputExternal ∈ A then z.2.2.2 else x.2.2.2)
/-- PDF pp.5–6: trace-and-replace, R_A C = (Tr_A C) tensor I_A/d_A,
in the ORIGINAL wire order. Summing over a full dummy register duplicates the
unselected coordinates d^(2k+2-|A|) times; the denominator d^(2k+2) cancels
that multiplicity and gives exactly the source's 1/d_A normalization. -/
def traceReplace {d k : ℕ} (A : Finset (WireLabel k))
(C : Op (ProcessBasis (uniformWires d k))) : Op (ProcessBasis (uniformWires d k)) :=
fun x y => if ∀ a ∈ A, wireCoordinate x a = wireCoordinate y a then
((d : ℂ)^(2*k+2))⁻¹ * ∑ z : ProcessBasis (uniformWires d k),
C (replaceCoordinates A x z) (replaceCoordinates A y z)
else 0
/-- PDF p.5: all oracle output wires plus the final external output. -/
def outputWires (k : ℕ) : Finset (WireLabel k) :=
insert .outputExternal (Finset.univ.image WireLabel.outputSlot)
/-- PDF p.5: all wires except the external input. -/
def futureWires (k : ℕ) : Finset (WireLabel k) :=
(Finset.univ : Finset (WireLabel k)).erase .inputExternal
/-- PDF p.5, Eq. (10): explicit finite affine parallel normalization equations. -/
def ParallelNormalized (d k : ℕ) (C : Op (ProcessBasis (uniformWires d k))) : Prop :=
C.PosSemidef ∧
traceReplace {WireLabel.outputExternal} C = traceReplace (outputWires k) C ∧
traceReplace (futureWires k) C = traceReplace Finset.univ C ∧
C.trace = (d : ℂ)^(k+1)
/-- PDF p.5, Eq. (12): wires strictly later than slot i, plus the final output. -/
def laterWires {k : ℕ} (i : Fin k) : Finset (WireLabel k) :=
insert .outputExternal
(((Finset.univ.filter (fun j : Fin k => i < j)).image WireLabel.inputSlot) ∪
((Finset.univ.filter (fun j : Fin k => i < j)).image WireLabel.outputSlot))
/-- PDF p.5, Eq. (12): finite sequential comb normalization, in fixed slot order.
The recursive partial traces are expressed as trace-and-replace in the full space. -/
def SequentialNormalized (d k : ℕ) (C : Op (ProcessBasis (uniformWires d k))) : Prop :=
C.PosSemidef ∧
(∀ i : Fin k, traceReplace (laterWires i) C =
traceReplace (insert (WireLabel.outputSlot i) (laterWires i)) C) ∧
traceReplace (futureWires k) C = traceReplace Finset.univ C ∧
C.trace = (d : ℂ)^(k+1)
/-- PDF pp.4–6: an actual family of independent CPTP slot-channel Choi matrices. -/
abbrev ChannelFamily {k : ℕ} (w : OracleWireDimensions k) :=
{J : (i : Fin k) → Op (Fin (w.outputSlot i) × Fin (w.inputSlot i)) //
∀ i, ChannelChoi (J i)}
/-- PDF pp.5–7: augmented span encodes the affine, rather than homogeneous,
normalization constraints. Its generators are actual independent channel tuples. -/
def channelAffineSpan {k : ℕ} (w : OracleWireDimensions k) :=
Submodule.span ℝ (Set.range (fun J : ChannelFamily w => (slotTensor J.val, (1 : ℝ))))
/-- PDF pp.5–7: finite exact normalization tests from a basis of the actual
augmented independent-channel span. No assertion about a numerical rank is used. -/
def IsNormalizationBasis {k : ℕ} (w : OracleWireDimensions k) (n : ℕ)
(B : Fin n → ChannelFamily w) : Prop :=
LinearIndependent ℝ (fun i => (slotTensor (B i).val, (1 : ℝ))) ∧
Submodule.span ℝ (Set.range (fun i => (slotTensor (B i).val, (1 : ℝ)))) =
channelAffineSpan w
/-- PDF pp.4–7: finite general-process normalization on independent slot
channels. Each output partial trace is an affine linear equality in C; C>=0
supplies complete CP preservation. This replaces no printed Eq. (14) by fiat. -/
def GeneralFiniteNormalized {k n : ℕ} (w : OracleWireDimensions k)
(B : Fin n → ChannelFamily w) (C : Op (ProcessBasis w)) : Prop :=
C.PosSemidef ∧ ∀ i, ChannelChoi (evaluateOracleSlots C (slotTensor (B i).val))
/-- PDF pp.5–7: the three explicit finite normalization systems. -/
def FiniteClassNormalized {d k n : ℕ} (c : ProtocolClass)
(B : Fin n → ChannelFamily (uniformWires d k))
(C : Op (ProcessBasis (uniformWires d k))) : Prop :=
match c with
| .parallel => ParallelNormalized d k C
| .adaptive => SequentialNormalized d k C
| .general => GeneralFiniteNormalized (uniformWires d k) B C
/-- PDF pp.6–7: both CP branches are retained and normalized jointly. -/
def HeraldedRealizable (c : ProtocolClass) (d k : ℕ)
(S F : Op (ProcessBasis (uniformWires d k))) : Prop :=
S.PosSemidef ∧ F.PosSemidef ∧ ClassRealizable c d k (S + F)
/-- PDF pp.9–10: a delayed parallel superinstrument, including its failure branch. -/
def DelayedInstrument {k : ℕ} (w : OracleWireDimensions k)
(S F : Op (ProcessBasis w)) : Prop :=
PositiveWires w ∧ S.PosSemidef ∧ F.PosSemidef ∧ DelayedRealizes w (S + F)
/-- PDF pp.6–7: identical uses of the unknown unitary channel. -/
def repeatedChoi {d : ℕ} (k : ℕ) (U : Matrix.unitaryGroup (Fin d) ℂ) :
Op (Outputs (uniformWires d k) × Inputs (uniformWires d k)) :=
slotTensor (w := uniformWires d k) (fun _ => gateChoi (U : Op (Fin d)))
/-- PDF pp.7,10,12,18: the unitary task, with channel equality removing global phases. -/
inductive UnitaryTask where
| identity
| transpose
| conjugate
| inverse
deriving DecidableEq
/-- PDF pp.7,10,12,18: transpose, entrywise conjugation, and inverse are different. -/
def targetChoi {d : ℕ} (task : UnitaryTask)
(U : Matrix.unitaryGroup (Fin d) ℂ) : Op (Fin d × Fin d) :=
match task with
| .identity => gateChoi (U : Op (Fin d))
| .transpose => gateChoi ((U : Op (Fin d)).transpose)
| .conjugate => gateChoi (fun i j => conj ((U : Op (Fin d)) i j))
| .inverse => gateChoi ((U : Op (Fin d))ᴴ)
/-- PDF pp.6–7: exact success as an equality of unnormalized channel Choi matrices.
This is equality on all inputs, including entangled references, with constant p. -/
def ExactUnitarySuccess {d k : ℕ} (S : Op (ProcessBasis (uniformWires d k)))
(target : Matrix.unitaryGroup (Fin d) ℂ → Op (Fin d × Fin d)) (p : ℝ) : Prop :=
∀ U, evaluateOracleSlots S (repeatedChoi k U) = (p : ℂ) • target U
/-- PDF pp.6–7: a single physical protocol precedes the universal unknown input. -/
def Attainable (c : ProtocolClass) (d k : ℕ)
(target : Matrix.unitaryGroup (Fin d) ℂ → Op (Fin d × Fin d)) (p : ℝ) : Prop :=
0 ≤ p ∧ p ≤ 1 ∧ ∃ S F, HeraldedRealizable c d k S F ∧ ExactUnitarySuccess S target p
/-- PDF pp.9,14–16: constant-success delayed-input protocols. -/
def DelayedAttainable (d k : ℕ)
(target : Matrix.unitaryGroup (Fin d) ℂ → Op (Fin d × Fin d)) (p : ℝ) : Prop :=
0 ≤ p ∧ p ≤ 1 ∧ ∃ S F,
DelayedInstrument (uniformWires d k) S F ∧ ExactUnitarySuccess S target p
/-- PDF p.7, Eq. (19): the actual repeated-unitary Choi span, not the ambient space. -/
def unitarySpan (d k : ℕ) :=
Submodule.span ℂ (Set.range (repeatedChoi (d := d) k))
/-- PDF p.7, Eq. (19): a finite basis consisting of actual unitary operations. -/
def IsUnitaryBasis (d k n : ℕ) (B : Fin n → Matrix.unitaryGroup (Fin d) ℂ) : Prop :=
LinearIndependent ℂ (fun i => repeatedChoi k (B i)) ∧
Submodule.span ℂ (Set.range (fun i => repeatedChoi k (B i))) = unitarySpan d k
/-- PDF pp.6–7, footnote 7: Section III assumes a linear channel target. -/
def UnitaryLinearTarget {d : ℕ}
(f : Op (Fin d × Fin d) →ₗ[ℂ] Op (Fin d × Fin d)) : Prop :=
∀ U : Matrix.unitaryGroup (Fin d) ℂ,
∃ V : Matrix.unitaryGroup (Fin d) ℂ, f (gateChoi (U : Op (Fin d))) = gateChoi (V : Op (Fin d))
/-- PDF p.7: finitely tested SDP feasibility, with both branches and a physical class. -/
def TestedFeasible {d k n : ℕ} (c : ProtocolClass)
(f : Op (Fin d × Fin d) →ₗ[ℂ] Op (Fin d × Fin d))
(B : Fin n → Matrix.unitaryGroup (Fin d) ℂ) (p : ℝ)
(S F : Op (ProcessBasis (uniformWires d k))) : Prop :=
0 ≤ p ∧ p ≤ 1 ∧ HeraldedRealizable c d k S F ∧
∀ i, evaluateOracleSlots S (repeatedChoi k (B i)) = (p : ℂ) • f (gateChoi (B i : Op (Fin d)))
/-- PDF p.9, Eq. (34): all identities are explicitly placed on I0 and O.
The remaining marginal is on I, with its source normalization preserved. -/
def DelayedNormalized {k : ℕ} (w : OracleWireDimensions k) (C : Op (ProcessBasis w)) : Prop :=
C.PosSemidef ∧
(∀ (i j : Fin w.inputExternal) (a b : Inputs w) (u v : Outputs w),
(∑ o, C (i,a,u,o) (j,b,v,o)) =
((1 : Op (Fin w.inputExternal)) i j / (w.inputExternal : ℂ)) *
(∑ t : Fin w.inputExternal, ∑ z : Outputs w, ∑ o : Fin w.outputExternal,
C (t,a,z,o) (t,b,z,o)) *
((1 : Op (Outputs w)) u v / (Fintype.card (Outputs w) : ℂ))) ∧
C.trace = ((w.inputExternal * Fintype.card (Outputs w) : ℕ) : ℂ)
/-- PDF p.10, Lemma 1: product of all wire dimensions, including both external wires. -/
def totalDimension {k : ℕ} (w : OracleWireDimensions k) : ℕ :=
w.inputExternal * w.outputExternal *
(∏ i, w.inputSlot i) * (∏ i, w.outputSlot i)
/-- PDF pp.12–13: the zero-Bell-outcome Kraus contraction, including the two
normalized maximally entangled amplitudes. Its matrix entries are U_(b,a)/d. -/
def bellZeroKraus {d : ℕ} (U : Op (Fin d)) : Op (Fin d) :=
fun a b => ∑ x, (if x = b then (d : ℂ)⁻¹ else 0) * U x a
/-- PDF p.14, footnote 14: a storage process has no external input and a
finite memory output; its k oracle slots may use any allowed causal ordering. -/
def storageWires (d k m : ℕ) : OracleWireDimensions k := ⟨1,m,fun _ => d,fun _ => d⟩
/-- PDF pp.14–16: the stored program is the memory state after all oracle uses.
The input to storage is the unique scalar state on the one-dimensional wire. -/
def storedProgram {d k m : ℕ} (C : Op (ProcessBasis (storageWires d k m)))
(U : Matrix.unitaryGroup (Fin d) ℂ) : Op (Fin m) :=
let J := slotTensor (w := storageWires d k m) (fun _ => gateChoi (U : Op (Fin d)))
fun a b => evaluateOracleSlots C J (a, (⟨0, by decide⟩ : Fin 1))
(b, (⟨0, by decide⟩ : Fin 1))
/-- PDF pp.14–16 and footnote 14: exact probabilistic learning, allowing the
most general storage process before the target input arrives. Its one-dimensional
past and common future are fixed; this introduces no undefined delayed-input
indefinite-order class. Retrieval has no oracle access, and both linear CP
retrieval branches sum to a CPTP channel. Ref. [24] permits parallel storage
without loss for attainable success; Lemma 3 supplies the task equivalence. -/
def LearningAttainable (d k : ℕ) (p : ℝ) : Prop :=
0 < d ∧ 0 ≤ p ∧ p ≤ 1 ∧
∃ m : ℕ, 0 < m ∧ ∃ C : Op (ProcessBasis (storageWires d k m)),
GeneralDeterministic (storageWires d k m) C ∧
∃ DS DF : Op (Fin d × Fin m) →ₗ[ℂ] Op (Fin d),
(taskOutputChoi DS).PosSemidef ∧ (taskOutputChoi DF).PosSemidef ∧
IsChannel (fun X => DS X + DF X) ∧
∀ (U : Matrix.unitaryGroup (Fin d) ℂ) X,
DS (X ⊗ₖ storedProgram C U) = (p : ℂ) • conjSuperop (U : Op (Fin d)) X
/-- PDF p.17: coherent control of permutations of k slots. The controlled product
acts on the system and leaves each order label untouched. -/
def switchMatrix {d k : ℕ} (U : Fin k → Op (Fin d)) :
Op ((Equiv.Perm (Fin k)) × Fin d) :=
fun a b => if a.1 = b.1 then
(((List.finRange k).map (fun i => U (a.1 i))).foldl (fun V W => W * V) (1 : Op (Fin d))) a.2 b.2
else 0
/-- PDF pp.13,16: parallel transposition success; positive denominator when d,k>0. -/
def parallelTransposeProbability (d k : ℕ) : ℝ :=
1 - ((d : ℝ)^2 - 1) / ((k : ℝ) + (d : ℝ)^2 - 1)
/-- PDF p.17: ceil(k/d) attempts, each successful with probability 1/d^2. -/
def adaptiveTransposeProbability (d k : ℕ) : ℝ :=
1 - (1 - 1 / (d : ℝ)^2)^((k + d - 1) / d)
/-- PDF pp.18–19: floor((k+1)/d) inversion attempts. -/
def adaptiveInverseProbability (d k : ℕ) : ℝ :=
1 - (1 - 1 / (d : ℝ)^2)^((k + 1) / d)
/-- PDF p.2: gate Choi trace normalization is d for the identity gate. -/
example (d : ℕ) : (gateChoi (1 : Op (Fin d))).trace = (d : ℂ) := by
simp [gateChoi, Matrix.trace, Fintype.sum_prod_type, Matrix.one_apply]
/-- PDF p.5: replacing no coordinates leaves the basis tuple unchanged. -/
example {d k : ℕ} (x z : ProcessBasis (uniformWires d k)) :
replaceCoordinates ∅ x z = x := by
rcases x with ⟨i,a,u,o⟩
simp [replaceCoordinates]
/-- PDF p.5: a zero-slot sequential computation is independent of its slot argument. -/
example {d m : ℕ} (E : Fin 0 → Superop (Fin m × Fin d) (Fin m × Fin d))
(J : Fin 0 → Op (Fin d × Fin d)) (X : Op (Fin m × Fin d)) :
sequentialRun E J X = X := by
simp [sequentialRun]
/-- PDF pp.12–13: the contraction has the transpose orientation and factor 1/d. -/
example {d : ℕ} (U : Op (Fin d)) (a b : Fin d) :
bellZeroKraus U a b = (d : ℂ)⁻¹ * U b a := by
simp [bellZeroKraus]
/-- PDF p.16: the one-qubit one-use optimum is 1/4. -/
example : parallelTransposeProbability 2 1 = 1/4 := by
norm_num [parallelTransposeProbability]
/-- PDF p.17: k=3,d=2 gives two transpose attempts; inversion gives two as well. -/
example : adaptiveTransposeProbability 2 3 = 7/16 ∧
adaptiveInverseProbability 2 3 = 7/16 := by
norm_num [adaptiveTransposeProbability, adaptiveInverseProbability]
end QAlgorithms.Papers.Independent.Intake100.P12
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intake100.P12.Attainable
For any protocol class chosen from parallel, adaptive, and general, natural numbers , arbitrary function from unitary matrices to complex matrices indexed by , where , and real number , this predicate holds exactly under the following conditions. One has , and there exist positive semidefinite complex matrices indexed by , where , such that , is positive semidefinite, and satisfies the selected realization condition described below. For a matrix indexed by , define the external matrix and its associated map by
The same convention associates a map to an external matrix indexed by , and to a single-slot matrix indexed by . A channel here means a map having a finite Kraus representation with . For the parallel class, there must exist a positive integer , a channel from matrices on to matrices on , and a channel in the reverse direction, such that, for every complex matrix on and every complex matrix on ,
The tensor extension acts separately on each block indexed by a pair of memory indices. For the adaptive class, there must exist a positive integer , channels from to , on that latter system for each , and back to . For every family of arbitrary complex single-slot matrices and every , set and ; the required equality is , where
For the general class, for every family of positive semidefinite single-slot matrices satisfying , the external matrix must be positive semidefinite and satisfy . Finally, for every unitary , one requires , where . These conditions exclude , allow , and include , when is a singleton, every slot product is , and the adaptive recurrence has no iterations.
QAlgorithms.Papers.Independent.Intake100.P12.ChannelFamily
For any natural number and any collection of natural-number wire dimensions—an external input dimension, an external output dimension, and input and output dimensions for every slot —this is the type of families of complex matrices, where is indexed by output–input pairs for slot , such that each is positive semidefinite and
The external dimensions impose no conditions on this type. Zero dimensions are permitted: a slot with positive input dimension and zero output dimension makes the type empty, whereas a zero input dimension gives a unique empty matrix satisfying its slot conditions. At , there is exactly one empty family.
QAlgorithms.Papers.Independent.Intake100.P12.ClassRealizable
For a value among , natural numbers , and a complex matrix indexed by , where , this predicate requires , , and the condition corresponding to below. Define, for any matrix on and matrix on ,
For , there must exist a positive memory dimension and channels from matrices on to matrices on , and from matrices on to matrices on , such that
for every arbitrary , with the identity acting on memory matrix blocks. For , there must exist a positive and channels , for every , and , such that for all arbitrary matrices , where
Every channel just mentioned must have a finite Kraus representation with . For , every family with must produce a positive semidefinite matrix
satisfying . The definition permits , using singleton tuple index sets and empty products equal to ; it is false when .
QAlgorithms.Papers.Independent.Intake100.P12.DelayedAttainable
For arbitrary natural numbers , an arbitrary function from unitary matrices to complex matrices indexed by , where , and a real number , this predicate means that and there exist positive semidefinite matrices on , with , satisfying the following requirements. The external input and output dimensions and every slot input and output dimension are positive, which here requires . There exist a positive integer , a positive semidefinite matrix of trace on , and a channel from matrices on to matrices on . A channel means a map for some finite family with . Define
using the analogous formula for the map associated to an external matrix on . For every arbitrary complex matrix on and every arbitrary complex matrix on , one requires
where the tensor extension applies separately to each memory-indexed block. In addition, for every unitary matrix , one requires , with
The value is permitted. The case is included: is then a singleton and the product defining is .
QAlgorithms.Papers.Independent.Intake100.P12.DelayedInstrument
For any natural number , any wire dimensions , and complex matrices indexed by , with external input , external output , slot-input tuple , and slot-output tuple , this predicate requires all external and slot dimensions to be strictly positive and requires positive semidefinite. Writing , there must exist a positive integer , a positive semidefinite matrix of trace on , and a channel from the external input together with to the external output, such that for every arbitrary complex matrix on and every arbitrary external input matrix ,
where
The memory extension applies to each matrix block with fixed memory row and column indices. Being a channel means that for some natural number and matrices satisfying . The case is included, in which both tuple sets are singletons.
QAlgorithms.Papers.Independent.Intake100.P12.DelayedNormalized
For a natural number , choose natural-number external dimensions and slot dimensions for ; these are respectively the external input, external output, slot input, and slot output fields of . Put , , and . For a complex matrix indexed by , the predicate means that is positive semidefinite, its complex trace is , and, for every , , and ,
All scalars in this equality are interpreted in . No dimension is required to be positive. Division uses , sums over empty index sets are zero, and when both product index sets are singletons and . If the full matrix index set is empty, its trace is zero, so the trace requirement can hold only if .
QAlgorithms.Papers.Independent.Intake100.P12.DelayedRealizes
For any natural number , let specify natural dimensions for the external input and output and dimensions for each slot . Write , , and let be a complex matrix indexed by . This predicate holds exactly when there exist a positive natural number , a positive semidefinite matrix of trace on , and a channel from matrices on to matrices on , such that, for every complex matrix on and every complex matrix on ,
where
Here applies separately to each matrix block indexed by the memory coordinates, and “channel” means that for some natural number and matrices satisfying . The equality is required for arbitrary , without positivity or normalization restrictions. No positivity assumption on the dimensions in , or on , is separately imposed; is allowed, with empty products of index sets interpreted as singleton sets.
QAlgorithms.Papers.Independent.Intake100.P12.ExactUnitarySuccess
For arbitrary natural numbers , put , , and . Given a complex matrix indexed by , an arbitrary function assigning a complex matrix indexed by to each unitary matrix, and a real number , this predicate holds exactly when, for every such unitary , the following equality of matrices holds:
Here acts as a complex scalar. The predicate imposes no positivity or normalization condition on or , and no restriction on . When , is a singleton and the product is , so the left side contains no dependence on . When , both sides are matrices with empty index sets, so the predicate holds for every real .
QAlgorithms.Papers.Independent.Intake100.P12.FiniteClassNormalized
For natural numbers , a choice among the three labels parallel, adaptive, and general, a collection of -slot families with all input and output dimensions equal to , and a complex matrix indexed by configurations , where , every is positive semidefinite and satisfies . For a set of the wire labels, define to be if agree on every selected coordinate, and otherwise; here ranges over all configurations. Let contain the external output and every slot output, let contain every label except the external input, let contain all labels, and let contain the external output and both wires of every slot . For the parallel label, the predicate requires positive semidefinite, , , and . For the adaptive label, it requires positive semidefinite, for every , , and the same trace equality. For the general label, it requires positive semidefinite and, for every , the matrix
to be positive semidefinite with . There is no independence or spanning requirement on ; its values do not enter the parallel or adaptive conditions. At , the slot-indexed conditions are vacuous and products equal ; at , the general condition requires only positive semidefinite. The value is allowed.
QAlgorithms.Papers.Independent.Intake100.P12.GeneralDeterministic
For any natural number , dimensions , and complex matrix indexed by , where and , this predicate requires for every , requires to be positive semidefinite, and requires the following for every family of positive semidefinite matrices on satisfying
The matrix on defined by
must be positive semidefinite and satisfy . Here is the Kronecker delta. The case is included: the slot index sets are singletons and the empty product is . If any required dimension is zero, the predicate is false.
QAlgorithms.Papers.Independent.Intake100.P12.GeneralFiniteNormalized
For any natural numbers , any wire dimensions , any collection of slot families, and any complex matrix indexed by , where , , , and , each slot matrix is, by its prescribed type, positive semidefinite with . Define
The predicate says precisely that is positive semidefinite and, for every , is positive semidefinite and . The collection is not required to satisfy any independence or spanning condition. Zero dimensions and are permitted, with empty products equal to ; when , the predicate reduces to positive semidefiniteness of .
QAlgorithms.Papers.Independent.Intake100.P12.HeraldedRealizable
For a label among parallel, adaptive, and general, natural numbers , and complex matrices on configurations , where , the predicate requires positive semidefinite and requires the following conditions on : , positive semidefinite, and the condition selected by below. For any complex matrix on , define
For any matrix on an output–input product, write ; extending a map by a memory set means applying separately to each block . Every channel mentioned here means a map of the form , for some natural number , with . For the parallel label, there must exist a positive integer , a channel from to , and a channel from to , such that, for every complex matrix on and every complex input matrix ,
For the adaptive label, there must exist a positive integer , a channel from to , channels on that latter space for every , and a channel back to , such that, for every family of arbitrary complex matrices on and every , setting , , and gives . For the general label, every family of positive semidefinite satisfying must give a positive semidefinite satisfying . The value is included, with empty products equal to and no sequential updates; cannot satisfy the predicate.
QAlgorithms.Papers.Independent.Intake100.P12.Inputs
For every natural number and every wire-dimension record whose slot input dimensions are , this abbreviates the configuration type
Thus an element chooses one valid input index for each slot. For , there is exactly one configuration, the empty assignment; if any slot input dimension is zero, there are no configurations. The other fields of do not affect this type.
QAlgorithms.Papers.Independent.Intake100.P12.IsNormalizationBasis
For any natural numbers , any wire dimensions , and any indexed collection of slot families, assume as part of the type of each that every slot matrix is positive semidefinite and satisfies . Write , , and
The predicate says that the pairs , regarded as vectors over in , are linearly independent and that their real linear span equals the real linear span of all pairs obtained from all slot families satisfying the same positivity and partial-trace conditions. No positivity of the dimensions or of is assumed, and the external dimensions impose no conditions. When , linear independence is vacuous, and the span equality holds exactly when there are no admissible slot families.
QAlgorithms.Papers.Independent.Intake100.P12.IsUnitaryBasis
For natural numbers and an indexed family of complex unitary matrices, put , , and define, for every unitary , the matrix
The predicate means that the matrices , indexed by , are linearly independent over , and that their complex linear span equals the complex linear span of all as ranges over every unitary matrix. All three natural-number parameters may be zero. In particular, an empty indexed family is allowed, but satisfies the predicate only when the latter span is zero; when , every is the scalar matrix , and the predicate requires .
QAlgorithms.Papers.Independent.Intake100.P12.LearningAttainable
For natural numbers and a real number , this predicate says that , , and there exist a positive natural number , a positive semidefinite complex matrix indexed by with and , and complex-linear maps , satisfying the following conditions. For every family of positive semidefinite matrices indexed by such that
the matrix
is positive semidefinite and has trace . For each , its matrix with entries
is positive semidefinite, where is the matrix unit. The sum map is a channel, meaning that there exist a natural number and matrices with such that for every matrix . Finally, for every unitary and every complex matrix ,
The quantifier over includes all matrices, without positivity or trace restrictions. The definition permits and ; for , the tuple sums have one term and the products are empty products equal to .
QAlgorithms.Papers.Independent.Intake100.P12.OracleWireDimensions
For every natural number , this defines a record consisting of two natural numbers , called the external input and output dimensions, and two functions , giving an input dimension and an output dimension for each slot . All dimensions may be zero. The case is included and has no slot dimensions.
QAlgorithms.Papers.Independent.Intake100.P12.Outputs
For every natural number and every wire-dimension record whose slot output dimensions are , this abbreviates the configuration type
Thus an element chooses one valid output index for each slot. For , there is exactly one configuration, the empty assignment; if any slot output dimension is zero, there are no configurations. The other fields of do not affect this type.
QAlgorithms.Papers.Independent.Intake100.P12.ParallelNormalized
For natural numbers , let , and let be a complex matrix indexed by configurations , with every coordinate in . The wire labels are the external input, the slot inputs, the slot outputs, and the external output. For any set of these labels, define by replacing the coordinates of labelled by with those of , and define the matrix
The sum runs over all configurations , and the inverse is taken in . The predicate holds precisely when is positive semidefinite, , , and . Both and are allowed: for , the configuration set is empty and the unique empty matrix satisfies these conditions; for , the first matrix equality is automatic.
QAlgorithms.Papers.Independent.Intake100.P12.ParallelRealizes
For every natural number , every wire-dimension record with external dimensions , input configurations , and output configurations , and every complex matrix indexed by tuples , this predicate means that there exist a positive natural number and channels from matrices on the external input indices to matrices on , and from matrices on to matrices on the external output indices, satisfying the following identity for every complex matrix on and every complex external input matrix :
Here a channel means a function admitting some finite family of rectangular complex matrices such that for every matrix and . No positivity condition on , positivity of the dimensions in , or restriction to channel matrices or density matrices is imposed. Zero dimensions use empty sums and may make the channel requirements impossible; for example, cannot exist if the external input dimension is positive and is empty. For , both slot configuration sets are singletons.
QAlgorithms.Papers.Independent.Intake100.P12.PositiveWires
For every natural number and every wire-dimension record , with external dimensions and slot dimensions for , this predicate means exactly
When , both conditions on slot dimensions are vacuous, while the two external dimensions must still be positive.
QAlgorithms.Papers.Independent.Intake100.P12.ProcessBasis
For every natural number and every wire-dimension record , with external dimensions and slot dimensions , this abbreviates the type of tuples where
For , the two slot assignments are uniquely empty. The type is empty if either external dimension or any slot dimension is zero.
QAlgorithms.Papers.Independent.Intake100.P12.ProtocolClass
This declaration defines a type with exactly three distinct values, named , , and , and equips it with decidable equality. The constructors carry no additional data.
QAlgorithms.Papers.Independent.Intake100.P12.SequentialNormalized
For natural numbers , let , and let be a complex matrix indexed by configurations containing an external input, slot inputs, slot outputs, and an external output, all taking values in . For a set of wire labels, write for replacement of the selected coordinates, and define
where ranges over all configurations and the inverse is in . For each , let contain the external output and both wires of every slot . The predicate holds precisely when is positive semidefinite,
There is no positivity assumption on or : at the unique empty matrix satisfies the predicate, and at the family of conditions indexed by is vacuous.
QAlgorithms.Papers.Independent.Intake100.P12.SequentialRealizes
For natural numbers , let and let be a complex matrix indexed by . This predicate holds exactly when there exist a positive natural number , channels from matrices on to matrices on , on the latter matrix space for every , and from that space to matrices on , such that for every family of arbitrary complex matrices on and every matrix on ,
where and , with
Each channel is required to admit a finite representation with . The definition separately assumes neither nor positivity of , and the quantified need not be positive or normalized. When , the product is , the tuple index set is a singleton, and the right-hand implementation is .
QAlgorithms.Papers.Independent.Intake100.P12.TestedFeasible
For arbitrary natural numbers , a protocol class chosen from parallel, adaptive, and general, a complex-linear map on matrices indexed by , a family of unitary matrices, a real number , and complex matrices on , where and , this predicate means that , are positive semidefinite, , and is positive semidefinite and has the selected realization described below. Define
with the same convention for maps associated to external or single-slot matrices on . A channel means a map for some finite Kraus family satisfying . In the parallel class, there must exist a positive integer , a channel from to , and a channel back to , such that
for all arbitrary complex matrices on and on , where the tensor extension acts separately on each memory-indexed block. In the adaptive class, there must exist a positive integer , channels from to , on that latter system for , and back to . For every family of arbitrary single-slot matrices and every , let , , and
One requires . In the general class, for every family of positive semidefinite single-slot matrices with , one requires to be positive semidefinite with . Finally, the tested equalities are
No basis or spanning assumption on , and no requirement that map every unitary matrix’s to another such matrix, is part of this predicate. If , the tested equalities are vacuous; if , is a singleton and all slot products equal .
QAlgorithms.Papers.Independent.Intake100.P12.UnitaryLinearTarget
For any natural number and any complex-linear map from complex matrices indexed by to matrices with that same index set, this predicate means that for every complex unitary matrix , there exists a complex unitary matrix such that
The existentially chosen may depend on , and its uniqueness is not asserted. The definition includes , when these matrices have empty index sets.
QAlgorithms.Papers.Independent.Intake100.P12.UnitaryTask
This defines a type with exactly four distinct constructors, named identity, transpose, conjugate, and inverse, with no arguments or additional data attached to any constructor, and equips the type with decidable equality.
QAlgorithms.Papers.Independent.Intake100.P12.WireLabel
For every natural number , this declaration defines a finite type consisting of an external input label, an external output label, an input slot label for each , and an output slot label for each . These labels are all distinct according to their constructors and indices, and the type has decidable equality and a finite enumeration. For , only the two external labels remain.
QAlgorithms.Papers.Independent.Intake100.P12.adaptiveInverseProbability
For every pair of natural numbers , this definition assigns
where the base uses real arithmetic and the exponent uses natural-number division. For , . The definition also includes , for which division by zero makes the exponent and the value is . Whenever the exponent is zero, the value is ; when , the base is zero and the exponent is positive, so the value is for every , including .
QAlgorithms.Papers.Independent.Intake100.P12.adaptiveTransposeProbability
For every pair of natural numbers , this definition assigns
where the base is computed in , is natural-number subtraction truncated at zero, and is natural-number division. Thus, when , the exponent is . No restriction excludes : natural-number division by zero gives exponent , and the defined value is then . An exponent of zero gives value , including when the base is zero, because ; consequently, for the value is at and at every .
QAlgorithms.Papers.Independent.Intake100.P12.bellZeroKraus
For every natural number and every arbitrary complex matrix , this defines the complex matrix whose entries are
Thus , with the scalar interpreted in . There is no unitarity assumption on . The case is included: the matrix is empty, and the scalar inverse is defined using .
QAlgorithms.Papers.Independent.Intake100.P12.channelAffineSpan
For any natural number and any wire dimensions , put and . Consider every family in which is a positive semidefinite complex matrix on the output–input pairs of slot and satisfies . Associate to it the matrix
The definition gives the real linear subspace of generated by all pairs ; explicitly, its elements are finite sums with arbitrary real coefficients , including the empty sum. The external wire dimensions play no role. If no such family exists, the subspace is . At , the matrix is the one-by-one matrix with entry , so the subspace is generated by the single pair .
QAlgorithms.Papers.Independent.Intake100.P12.evaluateOracleSlots
For every natural number , every wire-dimension record with external dimensions , input configurations , and output configurations , let be any complex matrix indexed by tuples of these external and slot indices, and let be any complex matrix indexed by . This defines a complex matrix indexed by external output–input pairs through
There are no positivity or normalization assumptions, and no entries are conjugated in this formula. Empty configuration sets give zero sums. For , each configuration set is a singleton, so the formula multiplies the corresponding entry of by the sole entry of .
QAlgorithms.Papers.Independent.Intake100.P12.futureWires
For every natural number , this definition returns the finite set of all wire labels except the external input label: it contains every input slot label and every output slot label indexed by , together with the external output label. Thus it has elements; for , it is the singleton containing the external output label.
QAlgorithms.Papers.Independent.Intake100.P12.gateChoi
For any types and any complex matrix with rows indexed by and columns indexed by , this defines a complex matrix indexed by with entries
Neither type is required to be finite, and no isometry or unitarity condition is imposed on . If either type is empty, the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Intake100.P12.laterWires
For any natural number and any index , this definition gives the finite set consisting of the external output wire together with the input and output wires of every slot whose index is strictly larger than :
Thus consists only of the external output when ; when , there is no permissible argument .
QAlgorithms.Papers.Independent.Intake100.P12.outputWires
For every natural number , this definition returns the finite set containing the external output label together with every output slot label indexed by , among the labels consisting of the two external labels and the input and output label for each slot. This set has elements; for , it is the singleton containing the external output label.
QAlgorithms.Papers.Independent.Intake100.P12.parallelTransposeProbability
For every pair of natural numbers , this definition assigns the real number
with and interpreted as real numbers in this expression. There are no positivity assumptions on either parameter and no accompanying assertion that the value lies in . Real division by zero is defined to be zero, so the value is when the denominator vanishes, namely at or ; in particular, the value is for every when .
QAlgorithms.Papers.Independent.Intake100.P12.repeatedChoi
For any natural numbers and any unitary complex matrix , this definition gives the complex matrix indexed by pairs consisting of a -tuple of output indices and a -tuple of input indices, all in , whose entries are
Here unitarity means . The case gives the one-by-one matrix with entry , including when ; if and , the indexing set is empty and the result is the empty matrix.
QAlgorithms.Papers.Independent.Intake100.P12.replaceCoordinates
For natural numbers , let consist of the external input and output labels and the input and output slot labels for every , and let be any finite subset of these labels. For any two tuples in
this definition returns the tuple whose coordinate at each label in is the corresponding coordinate of , and whose coordinate at every other label is the corresponding coordinate of . The four tuple components correspond respectively to the external input, slot inputs, slot outputs, and external output. In particular, returns , and taking all labels returns . The case has only the two external coordinates; for , no arguments exist.
QAlgorithms.Papers.Independent.Intake100.P12.sequentialRun
For arbitrary natural numbers , arbitrary functions from complex matrices on to matrices on that same set for every , arbitrary complex matrices on , and an arbitrary initial matrix on , this definition returns , where and, in increasing order ,
No linearity, channel, positivity, or normalization conditions are imposed on these functions or matrices. All three natural numbers may be zero; when , the returned matrix is .
QAlgorithms.Papers.Independent.Intake100.P12.slotTensor
For every natural number , every wire-dimension record with slot dimensions , and every family of complex matrices indexed by , this defines a complex matrix on , where and , by
No positivity or normalization is required. For , the configuration sets are singletons and the empty product gives the matrix with entry ; if any slot dimension is zero, the resulting matrix has an empty indexing type.
QAlgorithms.Papers.Independent.Intake100.P12.storageWires
For arbitrary natural numbers , this defines a collection of wire dimensions with slots: the external input dimension is , the external output dimension is , and each slot has input dimension and output dimension . Neither nor is required to be positive. When , there are no slots, and the external dimensions remain and .
QAlgorithms.Papers.Independent.Intake100.P12.storedProgram
For arbitrary natural numbers , write . Given any complex matrix indexed by tuples , where and , and any unitary matrix , this definition returns the matrix
Here is the sole element of the external input index set . No positivity or normalization condition is imposed on , so the definition itself does not assert that the resulting matrix is a density matrix. All three natural numbers may be zero: when , each tuple index set has one empty tuple and the product is ; when , the result is an empty matrix; and when , the summation index sets are empty and the result is zero.
QAlgorithms.Papers.Independent.Intake100.P12.switchMatrix
For arbitrary natural numbers and any family of complex matrices , this definition gives a matrix indexed by pairs , with a permutation of and , whose entries are
The product starts from and successively multiplies each matrix on the left in increasing order of its position in the permuted list. No unitarity assumption is imposed on the . When , the permutation set is a singleton and the empty product is ; when , the matrix has an empty index set.
QAlgorithms.Papers.Independent.Intake100.P12.targetChoi
For every natural number , every task chosen from identity, transpose, conjugate, and inverse, and every complex unitary matrix , this defines a complex matrix indexed by pairs in . For any matrix , write . The defined matrix is respectively , , , or , where denotes entrywise conjugation and denotes conjugate transpose. There is no normalization factor in . The definition includes , when the resulting matrix has an empty index set.
QAlgorithms.Papers.Independent.Intake100.P12.taskFromOutputChoi
For any finite type , any type , and any complex matrix indexed by , this defines a function from complex matrices to complex matrices by
There are no positivity or normalization assumptions on or , and need not be finite. If is empty, each displayed sum is zero, so the function returns the zero matrix.
QAlgorithms.Papers.Independent.Intake100.P12.taskOutputChoi
For any finite type with decidable equality, any type , and any function from complex matrices to complex matrices, this defines a complex matrix indexed by through
where has entry at and elsewhere. No linearity, positivity, or trace preservation of is assumed, and need not be finite. If either indexing type is empty, the resulting matrix has no entries.
QAlgorithms.Papers.Independent.Intake100.P12.totalDimension
For any natural number and any collection of natural-number dimensions consisting of external input dimension , external output dimension , slot input dimensions , and slot output dimensions for , this defines the natural number
No positivity assumptions are imposed. Each empty product is , so for the value is ; any zero factor makes the value zero.
QAlgorithms.Papers.Independent.Intake100.P12.traceReplace
For natural numbers , let , with coordinates labeled by the external input, the slot inputs, the slot outputs, and the external output. For any finite set of these labels and any complex matrix on , this definition returns the matrix
where replaces exactly the coordinates of labeled by with those of , and similarly for ; the inverse is taken in . There is no positivity or normalization assumption on . For , the coordinate condition is vacuous; when , the same formula uses the two external coordinates and the factor . If , the matrix index set is empty, the sum is empty, and the scalar inverse uses .
QAlgorithms.Papers.Independent.Intake100.P12.uniformWires
For every pair of natural numbers , this defines a wire-dimension record with slots by setting both external dimensions and every slot input and output dimension equal to . The value is allowed. When , there are no slots, and both external dimensions are still .
QAlgorithms.Papers.Independent.Intake100.P12.unitarySpan
For natural numbers , let and . This defines the complex linear subspace of matrices indexed by generated by all matrices
as ranges over all complex unitary matrices. Thus its elements are precisely finite complex linear combinations of these matrices, including the zero combination. The parameters may be zero: when , is a singleton and every is the scalar matrix ; when and , is empty and the defined subspace is the zero matrix space.
QAlgorithms.Papers.Independent.Intake100.P12.wireCoordinate
For any natural numbers and tuple
this definition assigns a coordinate in to each wire label: the external input and output labels receive and , and the input and output slot labels indexed by receive and . Here the labels are precisely those two external labels and the two slot labels for each . When , there are only external coordinates; when , no tuple exists.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.