def test_gr_equivalence(self): """Test global R gate is same as 3 individual R gates.""" circuit = GR(num_qubits=3, theta=np.pi / 3, phi=2 * np.pi / 3) expected = QuantumCircuit(3, name="gr") for i in range(3): expected.append(RGate(theta=np.pi / 3, phi=2 * np.pi / 3), [i]) self.assertEqual(expected, circuit.decompose())
def test_gry_equivalence(self): """Test global RY gates is same as 3 individual RY gates.""" circuit = GRY(num_qubits=3, theta=np.pi / 3) expected = GR(num_qubits=3, theta=np.pi / 3, phi=np.pi / 2) self.assertEqual(expected, circuit)