Commit 65dcc1bd authored by Carl Poelking's avatar Carl Poelking
Browse files

Cluster integration.

parent a403108e
......@@ -11,7 +11,7 @@ EnergySpectrum::EnergySpectrum(Spectrum &spectrum, Options &options) : _global_m
options_tmp.set("radialcutoff.Rc", _options->get<std::string>("energyspectrum.radialcutoff.Rc"));
options_tmp.set("radialcutoff.Rc_width", _options->get<std::string>("energyspectrum.radialcutoff.Rc_width"));
options_tmp.set("radialcutoff.center_weight", _options->get<std::string>("energyspectrum.radialcutoff.center_weight"));
if (_options->hasKey("radialcutoff.Rc_heaviside")) {
if (_options->hasKey("energyspectrum.radialcutoff.Rc_heaviside")) {
options_tmp.set("radialcutoff.Rc_heaviside", _options->get<std::string>("energyspectrum.radialcutoff.Rc_heaviside"));
}
_cutoff = CutoffFunctionOutlet().create(_options->get<std::string>("energyspectrum.radialcutoff.type"));
......
......@@ -227,7 +227,7 @@ class KernelAdaptorGlobalSpecificEnergy(object):
def __init__(self, options, types_global):
self.types_global = types_global
return
def adapt(self, espectrum, return_pos_matrix=False, dtype='float64'):
def adapt(self, energy_spectrum, return_pos_matrix=False, dtype='float64'):
dim_linear_ab = None
dim_linear_total = None
S = len(self.types_global)
......@@ -249,10 +249,11 @@ class KernelAdaptorGlobalSpecificEnergy(object):
j0 = isb*dim_linear_ab
j1 = j0+dim_linear_ab
X[i0:i1,j0:j1] = xab
X = X.flatten()
X = X/np.dot(X,X)**0.5
if return_pos_matrix:
return X, np.array([[0.,0.,0.]]), ["global"]
else: return X.flatten()
else: return X
class KernelAdaptorGlobalSpecific(object):
def __init__(self, options, types_global=None):
......@@ -261,7 +262,7 @@ class KernelAdaptorGlobalSpecific(object):
return
def getListAtomic(self, spectrum):
return [ spectrum.getGlobal() ]
def adapt(self, spectrum):
def adapt(self, spectrum, return_pos_matrix=False):
# EXTRACT A SET OF CENTER-BASED POWER EXPANSIONS
# Here: only global
IX = np.zeros((0,0), dtype='complex128')
......@@ -271,7 +272,9 @@ class KernelAdaptorGlobalSpecific(object):
dimX = Xi_norm.shape[0]
IX = np.copy(Xi_norm)
IX.resize((1,dimX))
return IX
if return_pos_matrix:
return IX, np.array([0.,0.,0.]), ["global"]
else: return IX
def adaptScalar(self, atomic):
xnklab_atomic = Xnklab(atomic, self.types)
X = xnklab_atomic.reduce()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment