def _enumerate_all_from_stabilizer_bases(
    stabilizer_basis: list[cirq.DensePauliString], n_qubits: int
):
    """Return the list of Pauli state that are spanned by the given Pauli basis.

    Args:
        stabilizer_basis: A list of Pauli strings that is the stabilizer basis
            to build all the Pauli strings.
        n_qubits: An integer that is the number of qubits.

    Returns:
        A list of Pauli strings that is the Pauli states built.
    """
    dense_pauli_strings = []
    for coefficients in itertools.product([False, True], repeat=n_qubits):
        dense_pauli_string = cirq.DensePauliString.eye(n_qubits)
        for keep, stabilizer in zip(coefficients, stabilizer_basis):
            if keep:
                dense_pauli_string *= stabilizer
        dense_pauli_strings.append(dense_pauli_string)
    return dense_pauli_strings
Return the list of Pauli state that are spanned by the given Pauli basis.

    Args:
        stabilizer_basis: A list of Pauli strings that is the stabilizer basis
            to build all the Pauli strings.
        n_qubits: An integer that is the number of qubits.

    Returns:
        A list of Pauli strings that is the Pauli states built.
    
examples/direct_fidelity_estimation.py