Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

TwoQubitBasisDecomposer

class TwoQubitBasisDecomposer(gate, basis_fidelity=1.0)

GitHub

A class for decomposing 2-qubit unitaries into minimal number of uses of a 2-qubit basis gate.


Methods

__call__

TwoQubitBasisDecomposer.__call__(target, basis_fidelity=None)

Decompose a two-qubit unitary over fixed basis + SU(2) using the best approximation given that each basis application has a finite fidelity.

decomp0

static TwoQubitBasisDecomposer.decomp0(target)

Decompose target ~Ud(x, y, z) with 0 uses of the basis gate. Result Ur has trace: Tr(Ur.Utargetdag)=4(cos(x)cos(y)cos(z)+jsin(x)sin(y)sin(z)|Tr(Ur.Utarget^dag)| = 4|(cos(x)cos(y)cos(z)+ j sin(x)sin(y)sin(z)|, which is optimal for all targets and bases

decomp1

TwoQubitBasisDecomposer.decomp1(target)

Decompose target ~Ud(x, y, z) with 1 uses of the basis gate ~Ud(a, b, c). Result Ur has trace: .. math:

|Tr(Ur.Utarget^dag)| = 4|cos(x-a)cos(y-b)cos(z-c) + j sin(x-a)sin(y-b)sin(z-c)|

which is optimal for all targets and bases with z==0 or c==0

decomp2_supercontrolled

TwoQubitBasisDecomposer.decomp2_supercontrolled(target)

Decompose target ~Ud(x, y, z) with 2 uses of the basis gate.

For supercontrolled basis ~Ud(pi/4, b, 0), all b, result Ur has trace .. math:

|Tr(Ur.Utarget^dag)| = 4cos(z)

which is the optimal approximation for basis of CNOT-class ~Ud(pi/4, 0, 0) or DCNOT-class ~Ud(pi/4, pi/4, 0) and any target. May be sub-optimal for b!=0 (e.g. there exists exact decomposition for any target using B B~Ud(pi/4, pi/8, 0), but not this decomposition.) This is an exact decomposition for supercontrolled basis and target ~Ud(x, y, 0). No guarantees for non-supercontrolled basis.

decomp3_supercontrolled

TwoQubitBasisDecomposer.decomp3_supercontrolled(target)

Decompose target with 3 uses of the basis. This is an exact decomposition for supercontrolled basis ~Ud(pi/4, b, 0), all b, and any target. No guarantees for non-supercontrolled basis.

num_basis_gates

TwoQubitBasisDecomposer.num_basis_gates(unitary)

Computes the number of basis gates needed in a decomposition of input unitary

traces

TwoQubitBasisDecomposer.traces(target)

Give the expected traces Tr(UUtargetdag)|Tr(U \cdot Utarget^dag)| for different number of basis gates.

Was this page helpful?
Report a bug or request content on GitHub.