QuantumComputinglib learn · inspect · formalize
Checked on this commit 4,524 public declarations commit c681192368c2 Build record

Lean source module

QuantumBlockEncoding/PrimitiveWireRename.lean

12 explicit public declarations in source order.

Back to Library Explorer

def · line 10

QuantumBlockEncoding.PrimitiveWireRename.basisEquiv

Compiled Compiled

This definition gives the library's named construction or computation for “basis equiv”.

def basisEquiv {m n : Nat} (e : Fin m ≃ Fin n) : PrimitiveBasis m ≃ PrimitiveBasis n where
  toFun b := fun w => b (e.symm w)
  invFun b := fun w => b (e w)
  left_inv b := by funext w; simp

commit-pinned source · Verso Blueprint panel

def · line 16

QuantumBlockEncoding.PrimitiveWireRename.gate

Compiled Compiled

This definition gives the library's named construction or computation for “gate”.

def gate {m n : Nat} (e : Fin m ≃ Fin n) : PrimitiveGate m → PrimitiveGate n
  | .x t => .x (e t)
  | .ry t a => .ry (e t) a
  | .rz t a => .rz (e t) a
  | .cx c t h => .cx (e c) (e t) (fun he => h (e.injective he))

commit-pinned source · Verso Blueprint panel

def · line 22

QuantumBlockEncoding.PrimitiveWireRename.circuit

Compiled Compiled

This definition gives the library's named construction or computation for “circuit”.

def circuit {m n : Nat} (e : Fin m ≃ Fin n) (c : PrimitiveCircuit m) : PrimitiveCircuit n :=
  c.map (gate e)

commit-pinned source · Verso Blueprint panel

def · line 25

QuantumBlockEncoding.PrimitiveWireRename.matrix

Compiled Compiled

This definition gives the library's named construction or computation for “matrix”.

noncomputable def matrix {m n : Nat} (e : Fin m ≃ Fin n)
    (M : _root_.Matrix (PrimitiveBasis m) (PrimitiveBasis m) ℂ) :
    _root_.Matrix (PrimitiveBasis n) (PrimitiveBasis n) ℂ :=
  _root_.Matrix.reindexAlgEquiv ℂ ℂ (basisEquiv e) M

commit-pinned source · Verso Blueprint panel

theorem · line 30

QuantumBlockEncoding.PrimitiveWireRename.matrix_apply

Compiled Compiled

Lean checks the proposition indexed as “matrix apply”; the hypotheses and conclusion in the code panel fix its exact scope.

@[simp] theorem matrix_apply {m n : Nat} (e : Fin m ≃ Fin n)
    (M : _root_.Matrix (PrimitiveBasis m) (PrimitiveBasis m) ℂ)
    (a b : PrimitiveBasis n) :
    matrix e M a b = M (fun w => a (e w)) (fun w => b (e w)) := rfl

commit-pinned source · Verso Blueprint panel

theorem · line 35

QuantumBlockEncoding.PrimitiveWireRename.matrix_mul

Compiled Compiled

Lean checks the proposition indexed as “matrix mul”; the hypotheses and conclusion in the code panel fix its exact scope.

theorem matrix_mul {m n : Nat} (e : Fin m ≃ Fin n)
    (M N : _root_.Matrix (PrimitiveBasis m) (PrimitiveBasis m) ℂ) :
    matrix e (M * N) = matrix e M * matrix e N :=
  map_mul (_root_.Matrix.reindexAlgEquiv ℂ ℂ (basisEquiv e)) M N

commit-pinned source · Verso Blueprint panel

theorem · line 58

QuantumBlockEncoding.PrimitiveWireRename.oneQubit

Compiled Compiled

Lean checks the proposition indexed as “one qubit”; the hypotheses and conclusion in the code panel fix its exact scope.

theorem oneQubit {m n : Nat} (e : Fin m ≃ Fin n) (t : Fin m)
    (M : _root_.Matrix (Fin 2) (Fin 2) ℂ) :
    liftPrimitiveOneQubit (e t) M = matrix e (liftPrimitiveOneQubit t M) := by

commit-pinned source · Verso Blueprint panel

theorem · line 83

QuantumBlockEncoding.PrimitiveWireRename.eval_gate

Compiled Compiled

Lean checks the proposition indexed as “eval gate”; the hypotheses and conclusion in the code panel fix its exact scope.

theorem eval_gate {m n : Nat} (e : Fin m ≃ Fin n) (g : PrimitiveGate m) :
    evalPrimitiveGate (gate e g) = matrix e (evalPrimitiveGate g) := by

commit-pinned source · Verso Blueprint panel

theorem · line 112

QuantumBlockEncoding.PrimitiveWireRename.eval_circuit

Compiled Compiled

Lean checks the proposition indexed as “eval circuit”; the hypotheses and conclusion in the code panel fix its exact scope. One actual renamed primitive list, with both boundary index maps exposed.

theorem eval_circuit {m n : Nat} (e : Fin m ≃ Fin n) (c : PrimitiveCircuit m) :
    evalPrimitiveCircuit (circuit e c) = matrix e (evalPrimitiveCircuit c) := by

commit-pinned source · Verso Blueprint panel

theorem · line 120

QuantumBlockEncoding.PrimitiveWireRename.gateCount

Compiled Compiled

Lean checks the proposition indexed as “gate count”; the hypotheses and conclusion in the code panel fix its exact scope.

@[simp] theorem gateCount {m n : Nat} (e : Fin m ≃ Fin n) (c : PrimitiveCircuit m) :
    (circuit e c).gateCount = c.gateCount := by simp [circuit]

commit-pinned source · Verso Blueprint panel

theorem · line 123

QuantumBlockEncoding.PrimitiveWireRename.ryCount

Compiled Compiled

Lean checks the proposition indexed as “ry count”; the hypotheses and conclusion in the code panel fix its exact scope.

@[simp] theorem ryCount {m n : Nat} (e : Fin m ≃ Fin n) (c : PrimitiveCircuit m) :
    (circuit e c).ryCount = c.ryCount := by

commit-pinned source · Verso Blueprint panel

theorem · line 129

QuantumBlockEncoding.PrimitiveWireRename.cxCount

Compiled Compiled

Lean checks the proposition indexed as “cx count”; the hypotheses and conclusion in the code panel fix its exact scope.

@[simp] theorem cxCount {m n : Nat} (e : Fin m ≃ Fin n) (c : PrimitiveCircuit m) :
    (circuit e c).cxCount = c.cxCount := by

commit-pinned source · Verso Blueprint panel