def freeze(self) -> cirq.FrozenCircuit:
        """Gets a frozen version of this circuit.

        Repeated calls to `.freeze()` will return the same FrozenCircuit
        instance as long as this circuit is not mutated.
        """
        from cirq.circuits.frozen_circuit import FrozenCircuit

        if self._frozen is None:
            self._frozen = FrozenCircuit._from_moments(self._moments)
        return self._frozen
Gets a frozen version of this circuit.

        Repeated calls to `.freeze()` will return the same FrozenCircuit
        instance as long as this circuit is not mutated.
        
cirq-core/cirq/circuits/circuit.py