Example #1
0
def test_generator_orbitals_am(spherical, am):
    kwargs = {
        "spherical_order": "cca",
        "cartesian_order": "cca",
        "spherical": spherical,
        "grad": 0
    }

    # Build a single orbital
    coeffs = [
        0.44135347600549724, 0.6934968471367846, 0.6641842253258472, 0.0001
    ]
    exponents = [38.36, 5.77, 1.24, 1.e-2]
    center = [0., 0., 0.]
    L = am

    ret = gg.collocation(xyzw, L, coeffs, exponents, center, **kwargs)["PHI"]
    orb = np.random.rand(3, ret.shape[0])
    bench = np.dot(orb, ret)

    del kwargs["grad"]
    ret = gg.orbital(orb, xyzw, L, coeffs, exponents, center, **kwargs)

    # Compare the results
    th.compare_collocation_results({"ORBITALS": bench}, {"ORBITALS": ret})
Example #2
0
#center = np.array([5, 5, 5])
center = np.array([0, 0, 0], dtype=np.double)

### Points

# Call pyGG
gg_out = build_out(nvals, npoints, 0)
tran_out = build_out(npoints, nvals, 0)
t = time.time()
if do_transpose:
    transpose_dict(gg_out, tran_out)

gg.collocation(xyz,
               L,
               coefs,
               exps,
               center,
               grad=0,
               spherical=spherical,
               out=gg_out)
#gg_out["PHI"] = gg_out["PHI"].copy().reshape(npoints, nvals).T
ctime = (time.time() - t)

# Call NP GG
t = time.time()
np_out = gg.ref.collocation(xyz,
                            L,
                            coefs,
                            exps,
                            center,
                            grad=0,
                            spherical=spherical,