cirq.testing.assert_circuits_have_same_unitary_given_final_permutation

Asserts two circuits have the same unitary up to a final permutation of qubits.

actual A circuit computed by some code under test.
expected The circuit that should have been computed.
qubit_map the permutation of qubits from the beginning to the end of the circuit.

ValueError if 'qubit_map' is not a mapping from the qubits in 'actual' to themselves.
ValueError if 'qubit_map' does not have the same set of keys and values.