def serialize(
        self, program: cirq.AbstractCircuit, msg: v2.program_pb2.Program | None = None
    ) -> v2.program_pb2.Program:
        """Serialize a Circuit to cirq_google.api.v2.Program proto.

        Args:
            program: The Circuit to serialize.
            msg: An optional proto object to populate with the serialization
                results.
        """
Serialize a Circuit to cirq_google.api.v2.Program proto.

        Args:
            program: The Circuit to serialize.
            msg: An optional proto object to populate with the serialization
                results.
        
cirq-google/cirq_google/serialization/serializer.py