def getElectronState(radicalElectrons, spinMultiplicity):
    """
    Return the electron state corresponding to the given number of radical
    electrons `radicalElectrons` and spin multiplicity `spinMultiplicity`.
    Raise a :class:`ValueError` if the electron state cannot be determined.
    """
    electronState = ''
    if radicalElectrons == 0: 
        electronState = '0'
    elif radicalElectrons == 1:
        electronState = '1'
    elif radicalElectrons == 2 and spinMultiplicity == 1:
        electronState = '2S'
    elif radicalElectrons == 2 and spinMultiplicity == 3: 
        electronState = '2T'
    elif radicalElectrons == 3: 
        electronState = '3'
    elif radicalElectrons == 4: 
        electronState = '4'
    else:
        raise ValueError('Unable to determine electron state for {0:d} radical electrons with spin multiplicity of {1:d}.'.format(radicalElectrons, spinMultiplicity))
    return electronState