TwoQubitWeylChamber
TwoQubitWeylChamber is a Julia package for analyzing two-qubit gates in the Weyl chamber. It is a partial port of the Python weylchamber
package.
The methods provided here allow to do an optimization for the entangling power of a two-qubit gate within the QuantumControl framework. See the examples for the optimization of a perfect entangler with the Krotov and GRAPE methods.
API
TwoQubitWeylChamber.D_PE
TwoQubitWeylChamber.canonical_gate
TwoQubitWeylChamber.gate_concurrence
TwoQubitWeylChamber.in_weyl_chamber
TwoQubitWeylChamber.local_invariants
TwoQubitWeylChamber.unitarity
TwoQubitWeylChamber.weyl_chamber_coordinates
TwoQubitWeylChamber.weyl_chamber_region
$\gdef\tr{\operatorname{tr}}$ $\gdef\Re{\operatorname{Re}}$
TwoQubitWeylChamber.D_PE
— MethodPerfect-entanglers distance measure.
D = D_PE(U; unitarity_weight=0.0, absolute_square=false)
For a given two-qubit gate $Û$, this is defined via the local_invariants
$g_1$, $g_2$, $g_3$ as
\[D = g_3 \sqrt{g_1^2 + g_2^2} - g_1\]
This describes the geometric distance of the quantum gate from the polyhedron of perfect entanglers in the Weyl chamber.
This equation is only meaningful under the assumption that $Û$ is unitary. If the two-qubit level are a logical subspace embedded in a larger physical Hilbert space, loss of population from the logical subspace may lead to a non-unitary $Û$. In this case, the unitarity
measure can be added to the functional by giving a unitary_weight
∈ [0, 1) that specifies the relative proportion of the $D$ term and the unitarity term.
By specifying absolute_square=true
, the functional is modified as $D → |D|²$, optimizing specifically for the boundary of the perfect entanglers polyhedron. This accounts for the fact that $D$ can take negative values inside the polyhedron, as well as the W1
region of the Weyl chamber (the one adjacent to SWAP). This may be especially useful in a system with population loss (unitarity_weight
> 0), as it avoids situations where the optimization goes deeper into the perfect entanglers while increasing population loss.
The functional does not check which region of the Weyl chamber the quantum gate is in. When using this for an optimization where the guess leads to a point in the W1
region of the Weyl chamber (close to SWAP), the sign of the functional must be flipped, or else it will optimize for SWAP. Alternatively, use absolute_square=true
.
The functional can be converted into the correct form for an optimization that uses one trajectory for each logical basis state by using QuantumControl.Functionals.gate_functional
.
TwoQubitWeylChamber.canonical_gate
— MethodConstruct the canonical gate for the given Weyl chamber coordinates.
Û = canonical_gate(c₁, c₂, c₃)
constructs the two qubit gate $Û$ as
\[Û = \exp\left[i\frac{π}{2} (c_1 σ̂_x σ̂_x + c_2 σ̂_y σ̂_y + c_3 σ̂_z σ̂_z)\right]\]
where $σ̂_{x,y,z}$ are the Pauli matrices.
TwoQubitWeylChamber.gate_concurrence
— MethodCalculate the maximum gate concurrence.
C = gate_concurrence(U)
C = gate_concurrence(c₁, c₂, c₃)
calculates that maximum concurrence $C ∈ [0, 1]$ that the two two-qubit gate U
, respectively the gate described by the Weyl chamber coordinates c₁
, c₂
, c₃
(see weyl_chamber_coordinates
) can generate.
Reference
- [1] Kraus and Cirac, Phys. Rev. A 63, 062309 (2001)
TwoQubitWeylChamber.in_weyl_chamber
— MethodCheck whether a given gate is in (a specific region of) the Weyl chamber.
in_weyl_chamber(c₁, c₂, c₃)
checks whether c₁
, c₂
, c₃
are valid Weyl chamber coordinates.
in_weyl_chamber(U; region="PE")
in_weyl_chamber(c₁, c₂, c₃; region="PE")
checks whether the two-qubit gate U
, respectively the gate described by the Weyl chamber coordinates c₁
, c₂
, c₃
(see weyl_chamber_coordinates
) is a perfect entangler. The region
can be any other of the regions returned by weyl_chamber_region
.
TwoQubitWeylChamber.local_invariants
— MethodCalculate the local invariants g₁, g₂, g₃ for a two-qubit gate.
g₁, g₂, g₃ = local_invariants(U)
TwoQubitWeylChamber.unitarity
— MethodUnitarity of a matrix.
pop_loss = 1 - unitarity(U)
measures the loss of population from the subspace described by U
. E.g., for a two-qubit gate, U
is a 4×4 matrix. The unitarity
is defined as $\Re[\tr(Û^†Û) / N]$ where $N$ is the dimension of $Û$.
TwoQubitWeylChamber.weyl_chamber_coordinates
— MethodCalculate the Weyl chamber coordinates c₁, c₂, c₃ for a two-qubit gate.
c₁, c₂, c₃ = weyl_chamber_coordinates(U)
calculates the Weyl chamber coordinates using the algorithm described in Childs et al. [2].
Reference
- [2] Childs et al.. Phys. Rev. A 68, 052311 (2003)
TwoQubitWeylChamber.weyl_chamber_region
— MethodIdentify which region of the Weyl chamber a given gate is located in.
region = weyl_chamber_region(U)
region = weyl_chamber_region(c₁, c₂, c₃)
identifies which region of the Weyl chamber the given two-qubit gate U
, respectively the gate identified by the Weyl chamber coordinates c₁
, c₂
, c₃
(see weyl_chamber_coordinates
) is in, as a string. Possible outputs are:
"PE"
: gate is in the polyhedron of perfect entanglers."W0"
: gate is between the identity and the perfect entanglers."W0*"
: gate is between CPHASE(2π) and the perfect entanglers."W1"
: gate is between SWAP and the perfect entanglers.
For invalid Weyl chamber coordinates, an empty string is returned.
References
- [1]
- B. Kraus and J. I. Cirac. Optimal Creation of Entanglement Using a Two-Qubit Gate. Phys. Rev. A 63, 062309 (2001).
- [2]
- A. Childs, H. Haselgrove and M. Nielsen. Lower bounds on the complexity of simulating quantum gates. Phys. Rev. A 68, 052311 (2003).