Exemple #1
0
def rotational_symmetry_number(mol):
    '''Number of unique orientations of the rigid molecule that only
    interchange identical atoms.

    Source http://cccbdb.nist.gov/thermo.asp (search "symmetry number")
    '''
    from pyscf import symm
    group = symm.detect_symm(mol._atom)[0]

    if group in ['SO3', 'C1', 'Ci', 'Cs', 'Coov']:
        sigma = 1
    elif group == 'Dooh':
        sigma = 2
    elif group in ['T', 'Td']:
        sigma = 12
    elif group == 'Oh':
        sigma = 24
    elif group == 'Ih':
        sigma = 60
    elif group[0] == 'C':  # 'Cn', 'Cnv', 'Cnh'
        sigma = int(''.join([x for x in group if x.isdigit()]))
    elif group[0] == 'D':  # 'Dn', 'Dnd', 'Dnh'
        sigma = 2 * int(''.join([x for x in group if x.isdigit()]))
    elif group[0] == 'S':  # 'Sn'
        sigma = int(''.join([x for x in group if x.isdigit()])) / 2
    else:
        raise RuntimeError("symmetry group: " + group)
    return sigma
Exemple #2
0
def get_so(atoms, basis):
    atoms = gto.mole.format_atom(atoms)
    gpname, origin, axes = symm.detect_symm(atoms)
    gpname, axes = symm.subgroup(gpname, axes)
    atoms = gto.mole.format_atom(atoms, origin, axes)
    eql_atoms = symm.symm_identical_atoms(gpname, atoms)
    so = symm.basis.symm_adapted_basis(gpname, eql_atoms, atoms, basis)[0]
    n = 0
    for c in so:
        if c.size > 0:
            n += c.shape[1]
    return n, so
Exemple #3
0
def get_so(atoms, basis):
    atoms = gto.mole.format_atom(atoms)
    gpname, origin, axes = symm.detect_symm(atoms)
    gpname, axes = symm.subgroup(gpname, axes)
    atoms = gto.mole.format_atom(atoms, origin, axes)
    eql_atoms = symm.symm_identical_atoms(gpname, atoms)
    so = symm.basis.symm_adapted_basis(gpname, eql_atoms, atoms, basis)[0]
    n = 0
    for c in so:
        if c.size > 0:
            n += c.shape[1]
    return n, so
Exemple #4
0
def get_so(atoms, basis, cart=False):
    atoms = gto.mole.format_atom(atoms)
    gpname, origin, axes = symm.detect_symm(atoms)
    gpname, axes = symm.subgroup(gpname, axes)
    atoms = gto.mole.format_atom(atoms, origin, axes, 'Bohr')
    mol = gto.M(atom=atoms, basis=basis, unit='Bohr', spin=None)
    mol.cart = cart
    so = symm.basis.symm_adapted_basis(mol, gpname)[0]
    n = 0
    for c in so:
        if c.size > 0:
            n += c.shape[1]
    assert(n == mol.nao_nr())
    return n, so
Exemple #5
0
def get_so(atoms, basis, cart=False):
    atoms = gto.mole.format_atom(atoms)
    gpname, origin, axes = symm.detect_symm(atoms)
    gpname, axes = symm.subgroup(gpname, axes)
    atoms = gto.mole.format_atom(atoms, origin, axes)
    try:
        mol = gto.M(atom=atoms, basis=basis)
    except RuntimeError:
        mol = gto.M(atom=atoms, basis=basis, spin=1)
    mol.cart = cart
    so = symm.basis.symm_adapted_basis(mol, gpname)[0]
    n = 0
    for c in so:
        if c.size > 0:
            n += c.shape[1]
    assert(n == mol.nao_nr())
    return n, so