# TwoQubitWeylDecomposition

*class *`qiskit.synthesis.TwoQubitWeylDecomposition(unitary_matrix, fidelity=0.999999999, *, _specialization=None)`

Bases: `object`

(opens in a new tab)

Two-qubit Weyl decomposition.

Decompose two-qubit unitary

$U = ({K_1}^l \otimes {K_1}^r) e^{(i a XX + i b YY + i c ZZ)} ({K_2}^l \otimes {K_2}^r)$where

$U \in U(4),~ {K_1}^l, {K_1}^r, {K_2}^l, {K_2}^r \in SU(2)$and we stay in the “Weyl Chamber”

$\pi /4 \geq a \geq b \geq |c|$This class avoids some problems of numerical instability near high-symmetry loci within the Weyl chamber. If there is a high-symmetry gate “nearby” (in terms of the requested average gate fidelity), then it return a canonicalized decomposition of that high-symmetry gate.

**References**

- Cross, A. W., Bishop, L. S., Sheldon, S., Nation, P. D. & Gambetta, J. M.,
*Validating quantum computers using randomized model circuits*, arXiv:1811.12926 [quant-ph](opens in a new tab) - B. Kraus, J. I. Cirac,
*Optimal Creation of Entanglement Using a Two-Qubit Gate*, arXiv:0011050 [quant-ph](opens in a new tab) - B. Drury, P. J. Love,
*Constructive Quantum Shannon Decomposition from Cartan Involutions*, arXiv:0806.4015 [quant-ph](opens in a new tab)

## Attributes

### a

Type: `float`

### b

Type: `float`

### c

Type: `float`

### global_phase

Type: `float`

### K1l

Type: `ndarray`

### K2l

Type: `ndarray`

### K1r

Type: `ndarray`

### K2r

Type: `ndarray`

### unitary_matrix

Type: `ndarray`

### requested_fidelity

Type: `float | None`

### calculated_fidelity

Type: `float`

## Methods

### actual_fidelity

`actual_fidelity(**kwargs)`

Calculates the actual fidelity of the decomposed circuit to the input unitary.

**Return type**

### circuit

`circuit(*, euler_basis=None, simplify=False, atol=1e-12)`

Returns Weyl decomposition in circuit form.

**Return type**

### from_bytes

*classmethod *`from_bytes(bytes_in, *, requested_fidelity, _specialization=None, **kwargs)`

Decode bytes into `TwoQubitWeylDecomposition`

.

**Return type**

### specialize

`specialize()`

Make changes to the decomposition to comply with any specializations.

This method will always raise a `NotImplementedError`

because there are no specializations to comply with in the current implementation.

The method `qiskit.synthesis.two_qubit.two_qubit_decompose.TwoQubitWeylDecomposition.specialize()`

is deprecated as of qiskit 1.1.0. It will be removed in the 2.0.0 release.