|
| 1 | +# Copyright 2024 Qiskit on IQM developers |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +"""MOVE gate to be used on the IQM Star architecture.""" |
| 15 | + |
| 16 | +import numpy as np |
| 17 | +import qiskit.quantum_info as qi |
| 18 | + |
| 19 | +from qiskit.circuit import Gate |
| 20 | + |
| 21 | +# MOVE gate has undefined phases, so we pick two arbitrary phases here |
| 22 | +_phase_1 = np.exp(0.7j) |
| 23 | +_phase_2 = 1.0 # np.exp(1.2j) |
| 24 | +MOVE_GATE_UNITARY = [ |
| 25 | + [1.0, 0.0, 0.0, 0.0], |
| 26 | + [0.0, 0.0, _phase_1, 0.0], |
| 27 | + [0.0, _phase_1.conj(), 0.0, 0.0], |
| 28 | + [0.0, 0.0, 0.0, _phase_2], |
| 29 | +] |
| 30 | +"""Unitary matrix for simulating the ideal MOVE gate. |
| 31 | +
|
| 32 | +This matrix is not a realistic description of MOVE, since it applies a zero phase on the moved |
| 33 | +state, and acts as identity in the :math:`|11\rangle` subspace, thus being equal to the SWAP gate.""" |
| 34 | + |
| 35 | + |
| 36 | +class MoveGate(Gate): |
| 37 | + r"""The MOVE operation is a unitary population exchange operation between a qubit and a resonator. |
| 38 | + Its effect is only defined in the invariant subspace :math:`S = \text{span}\{|00\rangle, |01\rangle, |10\rangle\}`, |
| 39 | + where it swaps the populations of the states :math:`|01\rangle` and :math:`|10\rangle`. |
| 40 | + Its effect on the orthogonal subspace is undefined. |
| 41 | +
|
| 42 | + MOVE has the following presentation in the subspace :math:`S`: |
| 43 | +
|
| 44 | + .. math:: \text{MOVE}_S = |00\rangle \langle 00| + a |10\rangle \langle 01| + a^{-1} |01\rangle \langle 10|, |
| 45 | +
|
| 46 | + where :math:`a` is an undefined complex phase that is canceled when the MOVE gate is applied a second time. |
| 47 | +
|
| 48 | + To ensure that the state of the qubit and resonator has no overlap with :math:`|11\rangle`, it is |
| 49 | + recommended that no single qubit gates are applied to the qubit in between a |
| 50 | + pair of MOVE operations. |
| 51 | +
|
| 52 | + .. note:: |
| 53 | + The MOVE gate must always be be applied on the qubit and the resonator in the |
| 54 | + order ``[qubit, resonator]``, regardless of which component is currently holding the state. |
| 55 | + """ |
| 56 | + |
| 57 | + def __init__(self, label=None): # noqa: ANN001 |
| 58 | + """Initializes the move gate""" |
| 59 | + super().__init__("move", 2, [], label=label) |
| 60 | + self.unitary = qi.Operator(MOVE_GATE_UNITARY) |
| 61 | + |
| 62 | + def _define(self): # noqa: ANN202 |
| 63 | + """This function is purposefully not defined so that that the Qiskit transpiler cannot accidentally |
| 64 | + decompose the MOVE gate into a sequence of other gates, instead it will throw an error. |
| 65 | + """ |
| 66 | + return |
0 commit comments