def decode(self, qubits: list[cirq.Qid], ancillas: list[cirq.Qid], state_vector) -> list[int]:
        """Computes the output of the circuit by projecting onto the \bar{Z}.

        Args:
            qubits: the qubits where the (now corrected) code words are stored.
            ancillas: the qubits where the syndrome is stored
            state_vector: a vector containing the state of the entire circuit

        Returns:
            The decoded and measured code words.
        """
        qubit_map = {qubit: i for i, qubit in enumerate(qubits + ancillas)}

        decoded = []
        for z in self.logical_Zs:
            pauli_string: cirq.PauliString = cirq.PauliString(dict(zip(qubits, z)))
            trace = pauli_string.expectation_from_state_vector(state_vector, qubit_map)
            decoded.append(round((1 - trace.real) / 2))
        return decoded
Computes the output of the circuit by projecting onto the ar{Z}.

        Args:
            qubits: the qubits where the (now corrected) code words are stored.
            ancillas: the qubits where the syndrome is stored
            state_vector: a vector containing the state of the entire circuit

        Returns:
            The decoded and measured code words.
        
examples/stabilizer_code.py