def assert_same_circuits(
    actual: circuits.AbstractCircuit, expected: circuits.AbstractCircuit
) -> None:
    """Asserts that two circuits are identical, with a descriptive error.

    Args:
        actual: A circuit computed by some code under test.
        expected: The circuit that should have been computed.
    """
    assert actual == expected, (
        "Actual circuit differs from expected circuit.\n"
        "\n"
        "Diagram of actual circuit:\n"
        f"{actual}\n"
        "\n"
        "Diagram of expected circuit:\n"
        f"{expected}\n"
        "\n"
        "Index of first differing moment:\n"
        f"{_first_differing_moment_index(actual, expected)}\n"
        "\n"
        "Full repr of actual circuit:\n"
        f"{actual!r}\n"
        "\n"
        "Full repr of expected circuit:\n"
        f"{expected!r}\n"
    )
Asserts that two circuits are identical, with a descriptive error.

    Args:
        actual: A circuit computed by some code under test.
        expected: The circuit that should have been computed.
    
cirq-core/cirq/testing/circuit_compare.py