def Get_Histogram_key_ancilla_system(qubitOperator, N_system_qubits, N_ancilla_qubits):
    """
    Function to give histogram key string of BOTH system and ancilla qubit lines.

    Args:
        qubitOperator (QubitOperator): Qubit operator to measure
        N_system_qubits (int): Number of system qubits / number of spin orbitals
        N_ancilla_qubits (int): Number of ancilla qubits

    Returns
        histogram_string (str): string of histogram key

    example

    x = QubitOperator('X0 Z2 Y3', 0.25j)
    N_ancilla_qubits = 2
    N_system_qubits = 5

    output = '0,2,3,5,6'


    """
    qubit_No, PauliStr = zip(*list(*qubitOperator.terms.keys()))

    histogram_string = ','.join([str(i) for i in (qubit_No)] + [str(i) for i in range(N_system_qubits, N_system_qubits + N_ancilla_qubits)])
    return histogram_string