# Path: openfermioncirq/_compat_test.py
# def deprecated_test(test: Callable) -> Callable:
#     """Marks a test as using deprecated functionality.
# 
#     Ensures the test is executed within the `pytest.deprecated_call()` context.
# 
#     Args:
#         test: The test.
# 
#     Returns:
#         The decorated test.
#     """
# 
#     @functools.wraps(test)
#     def decorated_test(*args, **kwargs) -> Any:
#         with pytest.deprecated_call():
#             test(*args, **kwargs)
# 
#     return decorated_test


import warnings
import numpy as np
import sympy
import cirq
import pytest
import openfermioncirq as ofc
from scipy.linalg import expm, kron
from openfermioncirq._compat_test import deprecated_test
                               np.array([[1, 0, 0, 0], [0, -1, 0, 0],
                                         [0, 0, -1, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=1)),
                               np.array([[1, 0, 0, 0], [0, 0, -1j, 0],
                                         [0, -1j, 0, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=0)),
                               np.array([[1, 0, 0, 0], [0, 1, 0, 0],
                                         [0, 0, 1, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=-1)),
                               np.array([[1, 0, 0, 0], [0, 0, 1j, 0],
                                         [0, 1j, 0, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    X = np.array([[0, 1], [1, 0]])
    Y = np.array([[0, -1j], [1j, 0]])
    XX = kron(X, X)
    YY = kron(Y, Y)
    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=0.25)),
                               expm(-1j * np.pi * 0.25 * (XX + YY) / 4))


@deprecated_test
@pytest.mark.parametrize('exponent', [1.0, 0.5, 0.25, 0.1, 0.0, -0.5])
def test_compare_xxyy_to_cirq_equivalent(exponent):

# Path: openfermioncirq/_compat_test.py
# def deprecated_test(test: Callable) -> Callable:
#     """Marks a test as using deprecated functionality.
# 
#     Ensures the test is executed within the `pytest.deprecated_call()` context.
# 
#     Args:
#         test: The test.
# 
#     Returns:
#         The decorated test.
#     """
# 
#     @functools.wraps(test)
#     def decorated_test(*args, **kwargs) -> Any:
#         with pytest.deprecated_call():
#             test(*args, **kwargs)
# 
#     return decorated_test


# Path: openfermioncirq/gates/common_gates_test.py
import warnings
import numpy as np
import sympy
import cirq
import pytest
import openfermioncirq as ofc
from scipy.linalg import expm, kron
from openfermioncirq._compat_test import deprecated_test

                               np.array([[1, 0, 0, 0], [0, -1, 0, 0],
                                         [0, 0, -1, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=1)),
                               np.array([[1, 0, 0, 0], [0, 0, -1j, 0],
                                         [0, -1j, 0, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=0)),
                               np.array([[1, 0, 0, 0], [0, 1, 0, 0],
                                         [0, 0, 1, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=-1)),
                               np.array([[1, 0, 0, 0], [0, 0, 1j, 0],
                                         [0, 1j, 0, 0], [0, 0, 0, 1]]),
                               atol=1e-8)

    X = np.array([[0, 1], [1, 0]])
    Y = np.array([[0, -1j], [1j, 0]])
    XX = kron(X, X)
    YY = kron(Y, Y)
    np.testing.assert_allclose(cirq.unitary(ofc.XXYYPowGate(exponent=0.25)),
                               expm(-1j * np.pi * 0.25 * (XX + YY) / 4))


@deprecated_test
@pytest.mark.parametrize('exponent', [1.0, 0.5, 0.25, 0.1, 0.0, -0.5])
def test_compare_xxyy_to_cirq_equivalent(exponent):

    old_gate = ofc.XXYYPowGate(exponent=exponent)