def as_sweep(
        self,
        circuit: circuits.AbstractCircuit,
        *,
        N: int,
        context: transformer_api.TransformerContext | None = None,
        prng: np.random.Generator | None = None,
    ) -> tuple[circuits.AbstractCircuit, cirq.Sweepable]:
        """Generates a parameterized circuit with *N* sets of sweepable parameters.

        Args:
            circuit: The input circuit to be processed by gauge compiling.
            N: The number of parameter sets to generate.
            context: A `cirq.TransformerContext` storing common configurable options for
                the transformers.
            prng: A pseudo-random number generator to select a gauge within a gauge cluster.
        """

        rng = np.random.default_rng() if prng is None else prng
        if context is None:
            context = transformer_api.TransformerContext(deep=False)
        if context.deep:
            raise ValueError('GaugeTransformer cannot be used with deep=True')
        new_moments: list[list[ops.Operation]] = []  # Store parameterized circuits.
        phxz_sid = itertools.count()
        two_qubit_gate_sid = itertools.count()
        # Map from "((pre|post),$qid,$moment_id)" to gate parameters.
        # E.g., {(post,q1,2): {"x_exponent": "x1", "z_exponent": "z1", "axis_phase": "a1"}}
        phxz_symbols_by_locs: dict[tuple[str, ops.Qid, int], dict[str, sympy.Symbol]] = {}
        # Map from "($q0,$q1,$moment_id)" to gate parameters.
        # E.g., {(q0,q1,0): ["s0"]}.
        two_qubit_gate_symbols_by_locs: dict[tuple[ops.Qid, ops.Qid, int], list[sympy.Symbol]] = {}

        def single_qubit_next_symbol() -> dict[str, sympy.Symbol]:
            sid = next(phxz_sid)
            return _parameterize_to_phxz(sid)

        def two_qubit_gate_next_symbol_list(n: int) -> list[sympy.Symbol]:
            """Returns symbols for 2 qubit gate parameterization."""
            sid = next(two_qubit_gate_sid)
            symbols: list[sympy.Symbol] = [sympy.Symbol(f"s{sid}_{sub}") for sub in range(n)]
            return symbols

        # Build parameterized circuit.
        for moment_id, moment in enumerate(circuit):
            center_moment: list[ops.Operation] = []
            left_moment: list[ops.Operation] = []
            right_moment: list[ops.Operation] = []
            for op in moment:
                if isinstance(op, ops.TaggedOperation) and set(op.tags).intersection(
                    context.tags_to_ignore
                ):
                    center_moment.append(op)
                    continue
                if op.gate is not None and op in self.target:
                    random_gauge = self.gauge_selector(rng).sample(op.gate, rng)
                    # Build symbols for 2-qubit-gates if the transformer might transform it,
                    # otherwise, keep it as it is.
                    if self.two_qubit_gate_symbolizer is not None:
                        symbols: list[sympy.Symbol] = two_qubit_gate_next_symbol_list(
                            self.two_qubit_gate_symbolizer.n_symbols
                        )
                        two_qubit_gate_symbols_by_locs[(op.qubits[0], op.qubits[1], moment_id)] = (
                            symbols
                        )
                        parameterized_2_qubit_gate, _ = self.two_qubit_gate_symbolizer(
                            random_gauge.two_qubit_gate, symbols
                        )
                        center_moment.append(parameterized_2_qubit_gate.on(*op.qubits))
                    else:
                        center_moment.append(op)
                    # Build symbols for the gauge, for a 2-qubit gauge, symbols will be built for
                    # pre/post q0/q1 and the new 2-qubit gate if the 2-qubit gate is updated in
                    # the gauge compiling.
                    for prefix, q in itertools.product(["pre", "post"], op.qubits):
                        xza_by_symbols = single_qubit_next_symbol()  # xza in phased xz gate.
                        phxz_symbols_by_locs[(prefix, q, moment_id)] = xza_by_symbols
                        new_op = ops.PhasedXZGate(**xza_by_symbols).on(q)
                        if prefix == "pre":
                            left_moment.append(new_op)
                        else:
                            right_moment.append(new_op)
                else:
                    center_moment.append(op)
            new_moments.extend(
                [moment for moment in [left_moment, center_moment, right_moment] if moment]
            )

        # Initialize the map from symbol names to their N values.
        values_by_params: dict[str, list[float]] = {
            **{
                str(symbol): []
                for symbols_by_names in phxz_symbols_by_locs.values()
                for symbol in symbols_by_names.values()
            },
            **{
                str(symbol): []
                for symbols in two_qubit_gate_symbols_by_locs.values()
                for symbol in symbols
            },
        }

        # Assign values for parameters via randomly chosen GaugeSelector.
        for _ in range(N):
            for moment_id, moment in enumerate(circuit):
                for op in moment:
                    if isinstance(op, ops.TaggedOperation) and set(op.tags).intersection(
                        context.tags_to_ignore
                    ):
                        continue
                    if op.gate is not None and len(op.qubits) == 2 and op in self.target:
                        gauge = self.gauge_selector(rng).sample(op.gate, rng)

                        # Get the params for 2 qubit gates.
                        if self.two_qubit_gate_symbolizer is not None:
                            _, vals_by_symbols = self.two_qubit_gate_symbolizer(
                                gauge.two_qubit_gate,
                                [
                                    *two_qubit_gate_symbols_by_locs[
                                        (op.qubits[0], op.qubits[1], moment_id)
                                    ]
                                ],
                            )
                            for symbol_str, val in vals_by_symbols.items():
                                values_by_params[symbol_str].append(float(val))

                        # Get the params of pre/post q0/q1 gates.
                        for pre_or_post, idx in itertools.product(["pre", "post"], [0, 1]):
                            gates = getattr(gauge, f"{pre_or_post}_q{idx}")
                            phxz_params = _gate_sequence_to_phxz_params(
                                gates,
                                phxz_symbols_by_locs[(pre_or_post, op.qubits[idx], moment_id)],
                            )
                            for key, value in phxz_params.items():
                                values_by_params[key].append(float(value))

        sweeps: list[Points] = [
            Points(key=key, points=values) for key, values in values_by_params.items()
        ]

        return circuits.Circuit.from_moments(*new_moments), Zip(*sweeps)
Generates a parameterized circuit with *N* sets of sweepable parameters.

        Args:
            circuit: The input circuit to be processed by gauge compiling.
            N: The number of parameter sets to generate.
            context: A `cirq.TransformerContext` storing common configurable options for
                the transformers.
            prng: A pseudo-random number generator to select a gauge within a gauge cluster.
        
cirq-core/cirq/transformers/gauge_compiling/gauge_compiling.py