View source on GitHub |
Phases the given matrices so that they agree on the phase of one entry.
cirq.match_global_phase(
a: np.ndarray, b: np.ndarray
) -> Tuple[np.ndarray, np.ndarray]
To maximize precision, the position with the largest entry from one of the matrices is used when attempting to compute the phase difference between the two matrices.
Args | |
---|---|
a
|
A numpy array. |
b
|
Another numpy array. |
Returns | |
---|---|
A tuple (a', b') where a' == b' implies a == b*exp(i t) for some t. |