diff --git a/qiskit_nature/circuit/library/__init__.py b/qiskit_nature/circuit/library/__init__.py index df5b9022fe..4f315b3ddc 100644 --- a/qiskit_nature/circuit/library/__init__.py +++ b/qiskit_nature/circuit/library/__init__.py @@ -73,7 +73,7 @@ UVCCSD, ) -from .gates import RYXXYGate +from .gates import YXMinusXYInteractionGate from .initial_states import HartreeFock, VSCF @@ -87,5 +87,5 @@ "UVCC", "UVCCSD", "VSCF", - "RYXXYGate", + "YXMinusXYInteractionGate", ] diff --git a/qiskit_nature/circuit/library/gates/__init__.py b/qiskit_nature/circuit/library/gates/__init__.py index 5cced20735..74ce7dc738 100644 --- a/qiskit_nature/circuit/library/gates/__init__.py +++ b/qiskit_nature/circuit/library/gates/__init__.py @@ -11,6 +11,6 @@ # that they have been altered from the originals. """Qiskit Nature Circuit Library Gates.""" -from .ryxxy import RYXXYGate +from .ryxxy import YXMinusXYInteractionGate -__all__ = ["RYXXYGate"] +__all__ = ["YXMinusXYInteractionGate"] diff --git a/qiskit_nature/circuit/library/gates/ryxxy.py b/qiskit_nature/circuit/library/gates/ryxxy.py index 2bad30db51..9f4cfe1f03 100644 --- a/qiskit_nature/circuit/library/gates/ryxxy.py +++ b/qiskit_nature/circuit/library/gates/ryxxy.py @@ -22,7 +22,7 @@ from qiskit.circuit.parameterexpression import ParameterValueType -class RYXXYGate(Gate): +class YXMinusXYInteractionGate(Gate): r"""A parametric 2-qubit :math:`Y \otimes X - X \otimes Y` interaction. These gates are used in the Givens rotation strategy for preparing @@ -145,4 +145,4 @@ def _define(self): def inverse(self): """Return inverse RYXXY gate.""" (theta,) = self.params - return RYXXYGate(-theta) + return YXMinusXYInteractionGate(-theta) diff --git a/test/circuit/library/gates/test_ryxxy.py b/test/circuit/library/gates/test_ryxxy.py index 1a9e28f7ff..abe877d7ee 100644 --- a/test/circuit/library/gates/test_ryxxy.py +++ b/test/circuit/library/gates/test_ryxxy.py @@ -17,7 +17,7 @@ from qiskit import QuantumCircuit from qiskit.quantum_info import Operator -from qiskit_nature.circuit.library import RYXXYGate +from qiskit_nature.circuit.library import YXMinusXYInteractionGate class TestRYXXYGate(QiskitNatureTestCase): @@ -25,31 +25,31 @@ class TestRYXXYGate(QiskitNatureTestCase): def test_matrix(self): """Test matrix.""" - gate = RYXXYGate(0) + gate = YXMinusXYInteractionGate(0) expected = np.eye(4) np.testing.assert_allclose(gate.to_matrix(), expected, atol=1e-7) - gate = RYXXYGate(np.pi / 4) + gate = YXMinusXYInteractionGate(np.pi / 4) a = np.sqrt(2) / 2 expected = np.array([[1, 0, 0, 0], [0, a, a, 0], [0, -a, a, 0], [0, 0, 0, 1]]) np.testing.assert_allclose(gate.to_matrix(), expected, atol=1e-7) - gate = RYXXYGate(np.pi / 2) + gate = YXMinusXYInteractionGate(np.pi / 2) expected = np.array([[1, 0, 0, 0], [0, 0, 1, 0], [0, -1, 0, 0], [0, 0, 0, 1]]) np.testing.assert_allclose(gate.to_matrix(), expected, atol=1e-7) - gate = RYXXYGate(np.pi) + gate = YXMinusXYInteractionGate(np.pi) expected = np.array([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]) np.testing.assert_allclose(gate.to_matrix(), expected, atol=1e-7) - gate = RYXXYGate(2 * np.pi) + gate = YXMinusXYInteractionGate(2 * np.pi) expected = np.eye(4) np.testing.assert_allclose(gate.to_matrix(), expected, atol=1e-7) def test_inverse(self): """Test inverse.""" theta = np.random.uniform(-10, 10) - gate = RYXXYGate(theta) + gate = YXMinusXYInteractionGate(theta) circuit = QuantumCircuit(2) circuit.append(gate, [0, 1]) circuit.append(gate.inverse(), [0, 1]) @@ -58,7 +58,7 @@ def test_inverse(self): def test_decompose(self): """Test decomposition.""" theta = np.random.uniform(-10, 10) - gate = RYXXYGate(theta) + gate = YXMinusXYInteractionGate(theta) circuit = QuantumCircuit(2) circuit.append(gate, [0, 1]) decomposed_circuit = circuit.decompose()