Quanlse/Utils/Functions.py
def computationalBasisList(qubitNum: int, sysLevel: int) -> List[str]:
    """
    Return a list of strings labeling eigenstates.
    For example, ``computationalBasisList(2, 3)`` will return:
    ``['00', '01', '02', '10', '11', '12', '20', '21', '22']``

    :param qubitNum: the number of qubits in the system
    :param sysLevel: the energy level of the qubits in the system
    :return: the list of strings labeling eigenstates
    """
    if not isinstance(sysLevel, int):
        raise ArgumentError('The system level can only be an integer.')
    itemCount = sysLevel ** qubitNum
    strList = []
    for index in range(itemCount):
        bStr = ''
        for qu in range(qubitNum):
            bStr = f"{int(index / sysLevel ** qu) % sysLevel}{bStr}"
        strList.append(bStr)
    return strList

    Return a list of strings labeling eigenstates.
    For example, ``computationalBasisList(2, 3)`` will return:
    ``['00', '01', '02', '10', '11', '12', '20', '21', '22']``

    :param qubitNum: the number of qubits in the system
    :param sysLevel: the energy level of the qubits in the system
    :return: the list of strings labeling eigenstates
    
Return a list of strings labeling eigenstates.
Return a list of strings labeling eigenstates .
def computationalBasisList(qubitNum: int, sysLevel: int) -> List[str]:
    if not isinstance(sysLevel, int):
        raise ArgumentError('The system level can only be an integer.')
    itemCount = sysLevel ** qubitNum
    strList = []
    for index in range(itemCount):
        bStr = ''
        for qu in range(qubitNum):
            bStr = f"{int(index / sysLevel ** qu) % sysLevel}{bStr}"
        strList.append(bStr)
    return strList
def computationalBasisList ( qubitNum : int , sysLevel : int ) -> List [ str ] : if not isinstance ( sysLevel , int ) : raise ArgumentError ( 'The system level can only be an integer.' ) itemCount = sysLevel ** qubitNum strList = [ ] for index in range ( itemCount ) : bStr = '' for qu in range ( qubitNum ) : bStr = f"{int(index / sysLevel ** qu) % sysLevel}{bStr}" strList . append ( bStr ) return strList
Return a list of strings labeling eigenstates.
Return a list of strings labeling eigenstates .
"""
    Return a list of strings labeling eigenstates.
    For example, ``computationalBasisList(2, 3)`` will return:
    ``['00', '01', '02', '10', '11', '12', '20', '21', '22']``

    :param qubitNum: the number of qubits in the system
    :param sysLevel: the energy level of the qubits in the system
    :return: the list of strings labeling eigenstates
    """
the list of strings labeling eigenstates
the list of strings labeling eigenstates
qubitNum
int
the number of qubits in the system
the number of qubits in the system
sysLevel
int
the energy level of the qubits in the system
the energy level of the qubits in the system