def measure_circuit(self, circuit: cirq.Circuit):
        """Measures the ancilla qubit and the memory qubit.

        There are two parameters in the circuit, `exponent` and `phase_exponent` corresponding
        to a possible rotation applied before the measurement on the memory with a
        `cirq.PhasedXPowGate`.

        Args:
            circuit: The circuit to measure.

        Returns:
            The circuit with the ancilla and memory qubits measured.
        """
        circuit.append(cirq.measure(self.ancilla, key='a'))
        circuit.append(
            [
                cirq.PhasedXPowGate(
                    exponent=sympy.Symbol('exponent'), phase_exponent=sympy.Symbol('phase_exponent')
                )(self.memory),
                cirq.measure(self.memory, key='m'),
            ]
        )

        return circuit
Measures the ancilla qubit and the memory qubit.

        There are two parameters in the circuit, `exponent` and `phase_exponent` corresponding
        to a possible rotation applied before the measurement on the memory with a
        `cirq.PhasedXPowGate`.

        Args:
            circuit: The circuit to measure.

        Returns:
            The circuit with the ancilla and memory qubits measured.
        
examples/hhl.py