Gates

The Qiskit QRyd Provider extends Qiskit with two-qubit gates that are specific to the Rydberg platform.

class qiskit_qryd_provider.PCZGate(label=None)[source]

Implements the phase-shifted controlled-Z gate (PCZ).

The PCZ gate is the controlled-Z gate up to single-qubit phase gates. It can be realized by the Rydberg platform in multiple ways [1, 2, 3].

Unitary matrix representation:

\[\begin{split}PCZ = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & e^{i\theta} & 0 & 0 \\ 0 & 0 & e^{i\theta} & 0 \\ 0 & 0 & 0 & e^{i(2\theta-\pi)} \end{pmatrix}\end{split}\]

The phase shift \(\theta\) has the default value 2.13, as calculated for experimentally realistic parameters [2]. It can be modified before using the QRydProvider via:

from qiskit_qryd_provider import PCZGate

PCZGate.set_theta(1.234)

assert PCZGate.get_theta() == 1.234
__init__(label=None)[source]

Create a new PCZ gate.

Parameters:

label (Optional[str]) – Optional label for the gate.

classmethod get_theta()[source]

Get the phase shift of the gate.

Return type:

float

Returns:

Angle of the phase shift.

classmethod set_kraus(kraus=None)[source]

Set the Kraus representation of the gate.

Parameters:

kraus (Optional[List[List[List[complex]]]]) – A three-dimensional array encoding the Kraus representation of the gate.

Return type:

None

classmethod set_theta(theta)[source]

Set the phase shift of the gate.

Note that after setting the phase shift to a new value, an updated decomposition of the PCZ gate is stored to Qiskit’s SessionEquivalenceLibrary.

Parameters:

theta (float) – Angle of the phase shift.

Return type:

None

to_kraus()[source]

Return the Kraus representation of the gate.

Raises:

NotImplementedError – If the Kraus representation is not set.

Return type:

Instruction

Returns:

An instruction encapsulating the Kraus representation.

to_matrix()[source]

Return the unitary matrix of the gate.

Return type:

List[List[complex]]

Returns:

A two-dimensional array for the gate unitary matrix.

class qiskit_qryd_provider.PCPGate(lam, label=None)[source]

Implements the phase-shifted controlled-phase gate (PCP).

This class implements an idealized version of a controlled-phase gate as it can potentially be realized by the Rydberg platform. Similarly to the PCZGate, the gate is hereby only realized up to single-qubit phase gates. The phase shift \(\theta\) depends on the phase \(\lambda\) of the gate.

Unitary matrix representation:

\[\begin{split}PCP = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & e^{i\theta(\lambda)} & 0 & 0 \\ 0 & 0 & e^{i\theta(\lambda)} & 0 \\ 0 & 0 & 0 & e^{i(2\theta(\lambda)+\lambda)} \end{pmatrix}\end{split}\]

Note that the \(\lambda\)-dependence that is implemented in this class is only accurate for \(\lambda \leq \pi\).

from qiskit_qryd_provider import PCPGate
import numpy as np

assert np.round(PCPGate.get_theta(np.pi), 2) == 2.13
__init__(lam, label=None)[source]

Create a new PCP gate.

Parameters:
  • lam (float) – Phase of the gate.

  • label (Optional[str]) – Optional label for the gate.

classmethod get_theta(lam)[source]

Get the phase shift of the gate for a given phase \(\lambda\).

Parameters:

lam (float) – Phase of the gate.

Return type:

float

Returns:

Angle of the phase shift.

classmethod set_kraus(kraus=None)[source]

Set the Kraus representation of the gate.

Parameters:

kraus (Optional[List[List[List[complex]]]]) – A three-dimensional array encoding the Kraus representation of the gate.

Return type:

None

to_kraus()[source]

Return the Kraus representation of the gate.

Raises:

NotImplementedError – If the Kraus representation is not set.

Return type:

Instruction

Returns:

An instruction encapsulating the Kraus representation.

to_matrix()[source]

Return the unitary matrix of the gate.

Return type:

List[List[complex]]

Returns:

A two-dimensional array for the gate unitary matrix.