-
Notifications
You must be signed in to change notification settings - Fork 125
feat(QuantumInfo): angle-parameterized qubit ket for Pancharatnam connection #1139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wock9000
wants to merge
1
commit into
leanprover-community:master
Choose a base branch
from
Xylem-Group:pancharatnam-qubit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /- | ||
| Copyright (c) 2026 Anand Nambakam. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Anand Nambakam | ||
| -/ | ||
| module | ||
|
|
||
| public import QuantumInfo.States.Pure.BlochSphere | ||
|
|
||
| /-! | ||
| # Pancharatnam Connection | ||
|
|
||
| The angle-parameterized qubit ket `qubitKet α θ` represents the quantum | ||
| state `cos(α/2)|0⟩ + e^{iθ}sin(α/2)|1⟩`, mapping to the Bloch sphere | ||
| at polar angle `α` and azimuthal angle `θ`. | ||
|
|
||
| ## Important definitions | ||
| * `qubitKet`: qubit state from Bloch sphere angles | ||
|
|
||
| ## Important results | ||
| * `dot_qubitKet`: inner product in half-angle form | ||
|
|
||
| ## References | ||
| * [S. Pancharatnam, *Generalized theory of interference, and its | ||
| applications*, Proc. Indian Acad. Sci. A 44, 247–262 (1956)][pancharatnam1956] | ||
| -/ | ||
|
|
||
| open Braket Complex | ||
|
|
||
| noncomputable section | ||
|
|
||
| /-- The raw vector for `qubitKet`. Internal helper. -/ | ||
| private def qubitKetVec (α θ : ℝ) : Fin 2 → ℂ := | ||
| ![↑(Real.cos (α / 2)), exp (↑θ * I) * ↑(Real.sin (α / 2))] | ||
|
|
||
| /-- A qubit state parameterized by Bloch sphere polar angle `α` and | ||
| azimuthal angle `θ`: `|ψ⟩ = cos(α/2)|0⟩ + e^{iθ}sin(α/2)|1⟩`. -/ | ||
| def qubitKet (α θ : ℝ) : Ket (Fin 2) where | ||
| vec := qubitKetVec α θ | ||
| normalized' := by | ||
| simp only [qubitKetVec, Fin.sum_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one, | ||
| Complex.norm_real, norm_mul, norm_exp_ofReal_mul_I, one_mul, Real.norm_eq_abs, sq_abs] | ||
| linarith [Real.sin_sq_add_cos_sq (α / 2)] | ||
|
|
||
| @[simp] | ||
| lemma qubitKet_apply_zero (α θ : ℝ) : | ||
| (qubitKet α θ) (0 : Fin 2) = ↑(Real.cos (α / 2)) := rfl | ||
|
|
||
| @[simp] | ||
| lemma qubitKet_apply_one (α θ : ℝ) : | ||
| (qubitKet α θ) (1 : Fin 2) = exp (↑θ * I) * ↑(Real.sin (α / 2)) := rfl | ||
|
|
||
| /-- The inner product of two angle-parameterized qubit states: | ||
| `⟨ψ₁|ψ₂⟩ = cos(α₁/2)cos(α₂/2) + e^{i(θ₂-θ₁)}sin(α₁/2)sin(α₂/2)`. -/ | ||
| lemma dot_qubitKet (α₁ θ₁ α₂ θ₂ : ℝ) : | ||
| 〈qubitKet α₁ θ₁‖qubitKet α₂ θ₂〉 = | ||
| ↑(Real.cos (α₁ / 2) * Real.cos (α₂ / 2)) + | ||
| exp (↑(θ₂ - θ₁) * I) * ↑(Real.sin (α₁ / 2) * Real.sin (α₂ / 2)) := by | ||
| unfold Braket.dot | ||
| simp only [Fin.sum_univ_two, Bra.eq_conj, qubitKet_apply_zero, qubitKet_apply_one] | ||
| simp only [map_mul, conj_ofReal, ofReal_mul] | ||
| rw [show starRingEnd ℂ (exp (↑θ₁ * I)) = exp (-(↑θ₁ * I)) from by | ||
| rw [← Complex.exp_conj]; congr 1; simp [conj_ofReal, conj_I, mul_neg]] | ||
| congr 1 | ||
| have : exp (-(↑θ₁ * I)) * ↑(Real.sin (α₁ / 2)) * | ||
| (exp (↑θ₂ * I) * ↑(Real.sin (α₂ / 2))) = | ||
| exp (-(↑θ₁ * I) + ↑θ₂ * I) * | ||
| (↑(Real.sin (α₁ / 2)) * ↑(Real.sin (α₂ / 2))) := by | ||
| rw [exp_add]; ring | ||
| rw [this] | ||
| congr 1 | ||
| congr 1 | ||
| push_cast | ||
| ring |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the stuff in this file is maybe more appropriate for the Braket or Qubit file