Isomorphisms
using PiccoloQuantumObjects
using SparseArrays # for visualizationLinear algebra operations on quantum objects are often performed on real vectors and matrices. We provide isomorphisms to convert between complex and real representations of quantum objects. These isomorphisms are used internally by the QuantumSystem type to perform quantum dynamics.
Quantum state isomorphisms
ket_to_isois the real isomorphism of a quantum stateψ ∈ ℂⁿiso_to_ketis the inverse isomorphism of a real vectorψ̃ ∈ ℝ²ⁿ
ψ = [1; 2] + im * [3; 4]
ψ̃ = ket_to_iso(ψ)4-element Vector{Int64}:
1
2
3
4iso_to_ket(ψ̃)2-element Vector{Complex{Int64}}:
1 + 3im
2 + 4imQuantum operator isomorphisms
We often need to convert a complex matrix U to a real vector Ũ⃗. We provoide the following isomorphisms to convert between the two representations.
iso_vec_to_operator(Ũ⃗::AbstractVector{ℝ})operator_to_iso_vec(U::AbstractVector{ℂ})iso_vec_to_iso_operator(Ũ⃗::AbstractVector{ℝ})iso_operator_to_iso_vec(Ũ::AbstractMatrix{ℝ})iso_operator_to_operator(Ũ::AbstractMatrix{ℝ})operator_to_iso_operator(U::AbstractMatrix{ℂ})
In additon, we provide mat(x::AbstractVector) to convert a vector x into a square matrix, as the inverse to Base's vec.
Julia uses column-major order.
U = [1 5; 2 6] + im * [3 7; 4 8]
Ũ⃗ = operator_to_iso_vec(U)8-element Vector{Int64}:
1
2
3
4
5
6
7
8iso_vec_to_operator(Ũ⃗)2×2 Matrix{Complex{Int64}}:
1+3im 5+7im
2+4im 6+8imDensity matrix isomorphisms
The isomorphisms for density matrices are:
density_to_iso_vec(ρ::AbstractMatrix{ℂ})iso_vec_to_density(ρ̃::AbstractVector{ℝ})
ρ = [1 2; 3 4] + im * [5 6; 7 8]
ρ̃⃗ = density_to_iso_vec(ρ)8-element Vector{Int64}:
1
3
2
4
5
7
6
8Quantum dynamics isomorphisms
The quantum dynamics isomorphisms, which correspond to these state transformations, are handled internally by the QuantumSystem type.
The Isomorphisms.iso isomorphism of a Hamiltonian $H$ is:
\[\text{iso}(H) := \widetilde{H} = \mqty(1 & 0 \\ 0 & 1) \otimes \Re(H) + \mqty(0 & -1 \\ 1 & 0) \otimes \Im(H)\]
where $\Im(H)$ and $\Re(H)$ are the imaginary and real parts of $H$ and the tilde indicates the standard isomorphism of a complex valued matrix:
\[\widetilde{H} := \mqty(1 & 0 \\ 0 & 1) \otimes \Re(H) + \mqty(0 & -1 \\ 1 & 0) \otimes \Im(H)\]
Hence, the generator Isomorphisms.G associated to a Hamiltonian $H$ is:
\[G(H) := \text{iso}(- i \widetilde{H}) = \mqty(1 & 0 \\ 0 & 1) \otimes \Im(H) - \mqty(0 & -1 \\ 1 & 0) \otimes \Re(H)\]
This page was generated using Literate.jl.