Skip to content

Commit 69c59f1

Browse files
authored
feat(M3.3): Fully stated and formalized. (#37)
* refactor: Remove `n <> 0` case for `block_decomp_general`. * feat(M3.3): Reverse direction. * refactor(M3.2): Use new permutation decomp. * feat(M3.3): Restate and reprove reverse direction. * feat(A.6): Restate and reprove (almost). Still missing some minor proof about natural numbers and modulo. * fix: Finish/simplify proof for `direct_sum_diagonal`. * feat(M3.3): Finish formalizing.
1 parent 54689d3 commit 69c59f1

File tree

9 files changed

+1149
-478
lines changed

9 files changed

+1149
-478
lines changed

AlgebraHelpers.v

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ Require Import QuantumLib.Complex.
22
(* @Kyle: this Matrix dependency is for just 1 thing. Maybe better to rewrite the sub_mul_mod
33
proof in here *)
44
Require Import QuantumLib.Matrix.
5+
6+
Lemma Cmult_nonzero : forall (a b : C), a <> C0 -> b <> C0 -> a * b <> C0.
7+
Proof.
8+
intros.
9+
intro.
10+
contradict H0.
11+
apply (Cmult_cancel_l a); auto.
12+
rewrite H1; lca.
13+
Qed.
14+
515
Lemma conj_mult_re_is_nonneg: forall (a: C),
616
Re (a^* * a) >= 0.
717
Proof.

ControlledUnitaries.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ assert (prod_decomp_1 : forall (w : Vector 2), WF_Matrix w -> U × (I 2 ⊗ Q)
8080
rewrite U_beta at 1. rewrite U_beta_p at 1.
8181
lma'.
8282
}
83-
destruct (@block_decomp_general 2 U) as [P00 [P01 [P10 [P11 [WF_P00 [WF_P01 [WF_P10 [WF_P11 U_block_decomp]]]]]]]]. lia.
83+
destruct (@block_decomp 2 U) as [P00 [P01 [P10 [P11 [WF_P00 [WF_P01 [WF_P10 [WF_P11 U_block_decomp]]]]]]]].
8484
apply U_unitary.
8585
assert (prod_decomp_2: forall (w : Vector 2), WF_Matrix w -> U × (I 2 ⊗ Q) × (∣0⟩ ⊗ w) = ∣0⟩ ⊗ (P00 × Q × w) .+ ∣1⟩ ⊗ (P10 × Q × w)).
8686
{
@@ -189,7 +189,7 @@ assert (I_4_block_decomp: I 4 = ∣0⟩⟨0∣ ⊗ I 2 .+ ∣0⟩⟨1∣ ⊗ Zer
189189
assert (equal_blocks: (P00) † × P00 = I 2 /\ (Zero (m:= 2) (n:=2)) = (Zero (m:= 2) (n:=2))
190190
/\ (Zero (m:= 2) (n:=2)) = (Zero (m:= 2) (n:=2)) /\ (P11) † × P11 = I 2).
191191
{
192-
apply block_equalities_general with (U := (U) † × U) (V := I 4).
192+
apply block_equalities with (U := (U) † × U) (V := I 4).
193193
lia.
194194
1,2,3,4,5,6,7,8: solve_WF_matrix.
195195
1,2: assumption.
@@ -497,4 +497,4 @@ exists (/ √ r .* psi), (/ √ (1 - r) .* phi).
497497
split. solve_WF_matrix.
498498
split. solve_WF_matrix.
499499
split. all: assumption.
500-
Qed.
500+
Qed.

GateHelpers.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ abgate U = ∣0⟩⟨0∣ ⊗ TL .+ ∣0⟩⟨1∣ ⊗ TR .+ ∣1⟩⟨1∣ ⊗
641641
Proof.
642642
intros U U_unitary zeropassthrough.
643643
destruct zeropassthrough as [y [WF_y zeropassthrough]].
644-
destruct (@block_decomp_general 2 U) as [TL [TR [BL [BR [WF_TL [WF_TR [WF_BL [WF_BR decomp]]]]]]]].
645-
lia. apply U_unitary.
644+
destruct (@block_decomp 2 U) as [TL [TR [BL [BR [WF_TL [WF_TR [WF_BL [WF_BR decomp]]]]]]]].
645+
apply U_unitary.
646646
exists (TL ⊗ I 2), (TR ⊗ I 2), (BR ⊗ I 2).
647647
split. solve_WF_matrix.
648648
split. solve_WF_matrix.
@@ -1265,7 +1265,7 @@ assert (WF_BL_block: WF_Matrix ((TR0) † × TL0)). solve_WF_matrix.
12651265
assert (WF_BR_block: WF_Matrix ((TR0) † × TR0 .+ (BR0) † × BR0)). solve_WF_matrix.
12661266
assert (self_eq: (abgate U) † × abgate U = (abgate U) † × abgate U). reflexivity.
12671267
assert (neq40: 4%nat <> 0%nat). lia.
1268-
assert (block_eq:= @block_equalities_general 4%nat ((abgate U) † × abgate U) ((abgate U) † × abgate U)
1268+
assert (block_eq:= @block_equalities 4%nat ((abgate U) † × abgate U) ((abgate U) † × abgate U)
12691269
((TL0) † × TL0) ((TL0) † × TR0) ((TR0) † × TL0) ((TR0) † × TR0 .+ (BR0) † × BR0) (I 4) Zero Zero (I 4) neq40
12701270
WF_TL0_inv WF_TR_block WF_BL_block WF_BR_block
12711271
(@WF_I 4) (@WF_Zero 4 4) (@WF_Zero 4 4) (@WF_I 4) block_mult abU_inv self_eq).
@@ -1340,4 +1340,4 @@ unfold swapbc.
13401340
rewrite kron_mixed_product.
13411341
rewrite Mmult_1_l. 2: solve_WF_matrix.
13421342
reflexivity.
1343-
Qed.
1343+
Qed.

0 commit comments

Comments
 (0)