def from_unitary_with_global_phase(
        cls, u: np.ndarray
    ) -> tuple[SingleQubitCliffordGate, complex] | None:
        """Creates Clifford gate with given unitary, including global phase.

        Args:
            u: 2x2 unitary matrix of a Clifford gate.

        Returns:
            A tuple of a SingleQubitCliffordGate and a global phase, such that
            the gate unitary (as given by `cirq.unitary`) times the global phase
            is identical to the given unitary `u`; or `None` if `u` is not the
            matrix of a single-qubit Clifford gate.
        """
        gate = cls.from_unitary(u)
        if gate is None:
            return None
        # Find the entry with the largest magnitude in the input unitary, to find
        # the global phase difference between the input unitary and the gate unitary.
        k = max(np.ndindex(*u.shape), key=lambda t: abs(u[t]))
        return gate, u[k] / protocols.unitary(gate)[k]
Creates Clifford gate with given unitary, including global phase.

        Args:
            u: 2x2 unitary matrix of a Clifford gate.

        Returns:
            A tuple of a SingleQubitCliffordGate and a global phase, such that
            the gate unitary (as given by `cirq.unitary`) times the global phase
            is identical to the given unitary `u`; or `None` if `u` is not the
            matrix of a single-qubit Clifford gate.
        
cirq-core/cirq/ops/clifford_gate.py