Unverified Commit 960407d9 authored by Jan Janssen's avatar Jan Janssen Committed by GitHub
Browse files

Pacemaker - remove pyiron_gpl from requirements

parent e838db4e
%% Cell type:code id: tags:
 
``` python
%pylab inline
```
 
%% Output
 
Populating the interactive namespace from numpy and matplotlib
 
%% Cell type:code id: tags:
 
``` python
from pyiron import Project
```
 
%% Cell type:code id: tags:
 
``` python
import pyiron_gpl
```
%% Cell type:code id: tags:
``` python
data_pr = Project("../../datasets")
if len(data_pr.job_table()) == 0:
data_pr.unpack("Cu_training_archive")
```
 
%% Cell type:code id: tags:
 
``` python
data_pr.job_table()
```
 
%% Output
 
id status chemicalformula job \
0 286 finished None df1_A1_A2_A3_EV_elast_phon
1 287 finished None df3_10k
2 288 finished None df2_1k
subjob projectpath \
0 /df1_A1_A2_A3_EV_elast_phon /home/yury/PycharmProjects/pyiron-2021/
1 /df3_10k /home/yury/PycharmProjects/pyiron-2021/
2 /df2_1k /home/yury/PycharmProjects/pyiron-2021/
project \
0 pyiron_potentialfit/datasets/imported_datasets/Cu_database/
1 pyiron_potentialfit/datasets/imported_datasets/Cu_database/
2 pyiron_potentialfit/datasets/imported_datasets/Cu_database/
timestart timestop totalcputime computer \
0 2021-02-08 10:33:52.341472 None None zora@cmti001#1
1 2021-02-08 10:33:53.993230 None None zora@cmti001#1
2 2021-02-08 10:33:54.435308 None None zora@cmti001#1
hamilton hamversion parentid masterid
0 TrainingContainer 0.4 None None
1 TrainingContainer 0.4 None None
2 TrainingContainer 0.4 None None
 
%% Cell type:markdown id: tags:
 
We will use smalles dataset for fitting, as real dataset took much more time, and go outside of the scope of the workshop
 
%% Cell type:code id: tags:
 
``` python
data_job = data_pr.load('df1_A1_A2_A3_EV_elast_phon')
```
 
%% Cell type:code id: tags:
 
``` python
data_job.to_pandas()
```
 
%% Output
 
name \
0 A1:FHI-aims/PBE/tight:elastic:s_e_0
1 A1:FHI-aims/PBE/tight:murnaghan:strain_1_0
2 A1:FHI-aims/PBE/tight:phonon:supercell_phonon_0
3 A1:FHI-aims/PBE/tight:murnaghan:strain_1_02
4 A1:FHI-aims/PBE/tight:murnaghan:strain_0_98
.. ...
100 A2:FHI-aims/PBE/tight:elastic:s_01_e_0_05000
101 A1:FHI-aims/PBE/tight:elastic:s_01_e_m0_05000
102 A3:FHI-aims/PBE/tight:elastic:s_01_e_m0_05000
103 A2:FHI-aims/PBE/tight:elastic:s_01_e_m0_05000
104 A2:FHI-aims/PBE/tight:elastic:s_23_e_m0_05000
atoms \
0 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
1 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
2 (Atom('Cu', [4.3368086899420173e-19, 0.007070999999999999, 0.007070999999999999], index=0), Atom('Cu', [3.3306690738754696e-16, 1.81563, 1.8156300000000005], index=1), Atom('Cu', [7.262518, 10.893...
3 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
4 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
.. ...
100 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
101 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
102 (Atom('Cu', [1.2150849, 0.70152958, 0.9998186400000001], index=0), Atom('Cu', [0.0, 1.40305917, 2.99945593], index=1))
103 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
104 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
energy \
0 -3.699843
1 -3.699841
2 -236.789603
3 -3.697932
4 -3.697559
.. ...
100 -3.573436
101 -3.546222
102 -7.079448
103 -3.513068
104 -3.494427
forces \
0 [[0.0, 0.0, 0.0]]
1 [[0.0, 0.0, 0.0]]
2 [[-1.13852957740976e-06, -0.0464638907314277, -0.0464636807741622], [-3.86335457040412e-06, 0.0124851330231607, 0.0124792943417333], [-1.94300535086066e-06, 6.63943441884098e-05, 6.92790474109119e...
3 [[0.0, 0.0, 0.0]]
4 [[0.0, 0.0, 0.0]]
.. ...
100 [[0.0, 0.0, 0.0]]
101 [[0.0, 0.0, 0.0]]
102 [[-3.5446112180968e-23, -1.13427558979097e-22, 0.0], [3.5446112180968e-23, 1.13427558979097e-22, 0.0]]
103 [[0.0, 0.0, 0.0]]
104 [[0.0, 0.0, 0.0]]
number_of_atoms
0 1.0
1 1.0
2 64.0
3 1.0
4 1.0
.. ...
100 1.0
101 1.0
102 2.0
103 1.0
104 1.0
[105 rows x 5 columns]
 
%% Cell type:markdown id: tags:
 
# Fitting project
 
%% Cell type:code id: tags:
 
``` python
fit_pr = Project("pacemaker_fit")
```
 
%% Cell type:code id: tags:
 
``` python
job = fit_pr.create_job(job_type=fit_pr.job_type.PaceMakerJob, job_name="df1_cut5_pyace")
```
 
%% Cell type:markdown id: tags:
 
## Fit
 
%% Cell type:code id: tags:
 
``` python
cutoff = 5.0 # potential cutoff
```
 
%% Cell type:markdown id: tags:
 
Potential specification
 
%% Cell type:code id: tags:
 
``` python
job.input["cutoff"] = cutoff # global potential cutoff
```
 
%% Cell type:code id: tags:
 
``` python
job.input["potential"]= {
"deltaSplineBins": 0.001, # spline bins, used for fast radial functions evaluations
 
"element": "Cu", # element - copper
 
"npot": "FinnisSinclairShiftedScaled", # embedding functions
"ndensity": 2, # number of densities: rho_1 and rho_2
"fs_parameters": [1, 1, 1, 0.5], # parameters of embedding functions (for two densities)
#this embedding function corresponds to rho_1 + sqrt(abs(rho_2)) , with some modifications
 
# radial base functions specification
"radbase": "ChebExpCos",
"radparameters": [5.25],
"rcut": cutoff,
"dcut": 0.01,
"NameOfCutoffFunction": "cos",
 
# MOST IMPORTANT: potential "shape" i.e.:
# number of orders (rank), maximum index of radial functions (nradmax) and orbital moments (lmax) for each rank
"rankmax": 3,
"nradmax": [7,2,1],
"lmax": [0,2,1],
}
```
 
%% Cell type:markdown id: tags:
 
Fitting settings:
 
%% Cell type:code id: tags:
 
``` python
job.input["fit"]= {
# loss function specification
'loss': {
'kappa': 0.5, # relative weight of forces residuals
 
# coefficients L1-L2 regularization
'L1_coeffs': 5e-7, # L1-regularization
'L2_coeffs': 5e-7, # L2-regularization
'w1_coeffs': 1,
'w2_coeffs': 1,
 
#radial smoothness regularization
'w0_rad': 1e-4, # for radial functions values
'w1_rad': 1e-4, # for radial functions first derivatives
'w2_rad': 1e-4, # for radial functions second derivatives
},
 
# minimization setup:
'optimizer': 'BFGS', # scipy BFGS algorithm
'maxiter': 150, # max number of iterations
}
```
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:markdown id: tags:
 
Assign the dataset to fit on
 
%% Cell type:code id: tags:
 
``` python
job.structure_data=data_job
```
 
%% Cell type:markdown id: tags:
 
Run fitting job
 
%% Cell type:code id: tags:
 
``` python
job.run()
```
 
%% Output
 
2021-03-08 11:13:01,028 - root - INFO - structure_data is TrainingContainer
2021-03-08 11:13:01,036 - root - INFO - Saving training structures dataframe into /home/yury/PycharmProjects/pyiron-2021/pyiron_potentialfit/day_2/03-ace/pacemaker_fit/df1_cut5_pyace_hdf5/df1_cut5_pyace/df_fit.pckl.gzip with pickle protocol = 4, compression = gzip
 
The job df1_cut5_pyace was saved and received the ID: 289
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:code id: tags:
 
``` python
fit_pr.job_table(full_table=True)
```
 
%% Output
 
id status chemicalformula job subjob \
0 289 finished None df1_cut5_pyace /df1_cut5_pyace
projectpath \
0 /home/yury/PycharmProjects/pyiron-2021/
project timestart \
0 pyiron_potentialfit/day_2/03-ace/pacemaker_fit/ 2021-03-08 11:13:01.402031
timestop totalcputime computer \
0 2021-03-08 11:18:19.154866 317.0 pyiron@dell-inspiron#1
hamilton hamversion parentid masterid
0 PaceMakerJob 0.1 None None
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:markdown id: tags:
 
# Analyse the fitting results
 
%% Cell type:markdown id: tags:
 
loss function
 
%% Cell type:code id: tags:
 
``` python
plt.plot(job["output/log/loss"])
plt.yscale('log')
plt.xlabel("# iter")
plt.ylabel("Loss");
```
 
%% Output
 
 
%% Cell type:markdown id: tags:
 
RMSE of energies per atoms
 
%% Cell type:code id: tags:
 
``` python
plt.plot(job["output/log/rmse_energy"])
plt.yscale('log')
plt.xlabel("# iter")
plt.ylabel("Energy RMSE, meV/atom");
```
 
%% Output
 
 
%% Cell type:markdown id: tags:
 
RMSE of forces norm
 
%% Cell type:code id: tags:
 
``` python
plt.plot(job["output/log/rmse_forces"])
plt.yscale('log')
plt.xlabel("# iter")
plt.ylabel("Forces RMSE, meV/Ang/structure");
```
 
%% Output
 
 
%% Cell type:markdown id: tags:
 
# Overview of the fitted potential internals
 
%% Cell type:code id: tags:
 
``` python
from pyace import *
```
 
%% Cell type:code id: tags:
 
``` python
final_potential = job.get_final_potential()
final_basis_set = ACEBBasisSet(final_potential)
```
 
%% Cell type:markdown id: tags:
 
For single-species potential there is only one **species block** for *Cu*:
 
%% Cell type:code id: tags:
 
``` python
len(final_potential.funcspecs_blocks)
```
 
%% Output
 
1
 
%% Cell type:code id: tags:
 
``` python
Cu_block = final_potential.funcspecs_blocks[0]
```
 
%% Cell type:markdown id: tags:
 
Basic definitions and notations:
 
* Radial functions: $R_{nl}(r) = \sum_k c_{nlk} g_k(r)$
 
 
* Spherical harmonics: $ Y_{lm}(\hat{\pmb{r}}_{ji}) $
 
 
* Basis function: $\phi_{\mu_j \mu_i nlm}(\pmb{r}_{ji}) = R_{nl}^{\mu_j \mu_i}(r_{ji}) Y_{lm}(\hat{\pmb{r}}_{ji}) $
 
 
* Atomic base (A-functions): $ A_{i \mu n l m} = \sum_j \delta_{\mu \mu_j} \phi_{\mu_j\mu_i nlm}(\pmb{r}_{ji}) $
 
 
* Product of atomic base: $ \pmb{A}_{i\pmb{\mu n l m}} = \prod_{t = 1}^{\nu} A_{i \mu_t n_t l_t m_t} $
 
 
* Equivariant basis (B-functions): $ {B}_{i\pmb{\mu n l L}} = \sum_{\pmb{m}} \left(
\begin{array}{c}
\pmb{l m} \\
\pmb{L M}
\end{array}
L_R
\right) \pmb{A}_{i\pmb{\mu n l m}} $ ,
 
where $ \left(\begin{array}{c} \pmb{l m} \\ \pmb{L M}\end{array} L_R\right) $ is *generalized Clebsh-Gordan coefficients*
 
 
* Atomic property (densities) $ \rho_i^{(p)} = \sum_{\pmb{\mu n l L}} {c}^{(p)}_{\mu_i\pmb{\mu n l L}} {B}_{i\pmb{\mu n l L}} $
 
 
* Atomic energy: $ E_i = F(\rho_i^{(1)}, \dots,\rho_i^{(P)} ) $, where $F$ is embedding function
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:markdown id: tags:
 
radial coefficients $c_{nlk}$:
 
%% Cell type:code id: tags:
 
``` python
np.shape(Cu_block.radcoefficients)
```
 
%% Output
 
(2, 3, 7)
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:markdown id: tags:
 
Visualize the radial basis functions ($g_k$) and radial functions ($R_{nl}$) and their derivatives:
 
%% Cell type:code id: tags:
 
``` python
RadialFunctionsVisualization(final_basis_set).plot()
```
 
%% Output
 
 
%% Cell type:markdown id: tags:
 
Total number of basis functions
 
%% Cell type:code id: tags:
 
``` python
len(Cu_block.funcspecs)
```
 
%% Output
 
18
 
%% Cell type:markdown id: tags:
 
List of B-basis functions $ {B}_{i\pmb{\mu n l L}}$: $\pmb{\mu} = $ `elements`, $\pmb{n} = $ `ns`, $\pmb{l} = $ `ls`, $\pmb{L} = $ `LS`) and corresponding coefficients $ {c}^{(p)}_{\mu_i\pmb{\mu n l L}} =$ `coeffs` for two densities
 
%% Cell type:code id: tags:
 
``` python
Cu_block.funcspecs
```
 
%% Output
 
[BBasisFunctionSpecification(elements=[Cu,Cu], ns=[1], ls=[0], coeffs=[-0.947664,-0.20673]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[2], ls=[0], coeffs=[0.127744,0.0378252]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[3], ls=[0], coeffs=[0.395046,0.128133]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[4], ls=[0], coeffs=[0.490821,0.17195]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[5], ls=[0], coeffs=[0.192457,0.100866]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[6], ls=[0], coeffs=[-0.381239,-0.0435031]),
BBasisFunctionSpecification(elements=[Cu,Cu], ns=[7], ls=[0], coeffs=[-0.717072,-0.124286]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[1,1], ls=[0,0], coeffs=[0.176241,0.135483]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[1,1], ls=[1,1], coeffs=[0.0335965,0.00542081]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[1,1], ls=[2,2], coeffs=[0.361527,0.101027]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,1], ls=[0,0], coeffs=[0.953892,0.247374]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,1], ls=[1,1], coeffs=[-0.000366411,-0.000581538]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,1], ls=[2,2], coeffs=[0.0654394,0.0146316]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,2], ls=[0,0], coeffs=[0.142427,0.0350483]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,2], ls=[1,1], coeffs=[0.00472481,6.57905e-05]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu], ns=[2,2], ls=[2,2], coeffs=[0.00853967,-0.000426002]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu,Cu], ns=[1,1,1], ls=[0,0,0], LS=[0], coeffs=[-0.0106058,-0.0227657]),
BBasisFunctionSpecification(elements=[Cu,Cu,Cu,Cu], ns=[1,1,1], ls=[1,1,0], LS=[0], coeffs=[0.309698,0.0822887])]
 
%% Cell type:markdown id: tags:
 
Compare to potential "shape" i.e.:
* "rankmax": 3
* "nradmax": [7,2,1]
* "lmax": [0,2,1]
 
%% Cell type:code id: tags:
 
``` python
print("Trainable parameters number")
print()
print("B-functions coefficients: ",Cu_block.ndensityi * len(Cu_block.funcspecs))
print("Radial functions coefficients: ",len(np.array(Cu_block.radcoefficients).flatten()))
print("-"*40)
print("Total number of trainable parameters: ",len(final_potential.get_all_coeffs()))
```
 
%% Output
 
Trainable parameters number
B-functions coefficients: 36
Radial functions coefficients: 42
----------------------------------------
Total number of trainable parameters: 78
 
%% Cell type:markdown id: tags:
 
# Test fitted potential
 
%% Cell type:code id: tags:
 
``` python
test_pr = Project("test_ace_potential")
```
 
%% Cell type:code id: tags:
 
``` python
test_pr.remove_jobs_silently()
```
 
%% Cell type:code id: tags:
 
``` python
test_pr.job_table()
```
 
%% Output
 
id status chemicalformula job subjob \
0 290 aborted Cu4 opt_lammps /opt_lammps
projectpath \
0 /home/yury/PycharmProjects/pyiron-2021/
project \
0 pyiron_potentialfit/day_2/03-ace/test_ace_potential/
timestart timestop totalcputime \
0 2021-03-08 11:19:06.338172 2021-03-08 11:19:06.828952 0.0
computer hamilton hamversion parentid masterid
0 pyiron@dell-inspiron#1 Lammps 0.1 None None
 
%% Cell type:code id: tags:
 
``` python
cu_ace_potential = job.get_lammps_potential()
```
 
%% Cell type:code id: tags:
 
``` python
cu_ace_potential
```
 
%% Output
 
Config \
0 [pair_style pace\n, pair_coeff * * /home/yury/PycharmProjects/pyiron-2021/pyiron_potentialfit/day_2/03-ace/pacemaker_fit/df1_cut5_pyace_hdf5/df1_cut5_pyace/df1_cut5_pyace.ace Cu\n]
Filename Model Name Species
0 ACE df1_cut5_pyace [Cu]
 
%% Cell type:markdown id: tags:
 
## Optimization
 
%% Cell type:code id: tags:
 
``` python
lammps_job = test_pr.create.job.Lammps("opt_lammps", delete_existing_job=True)
```
 
%% Cell type:code id: tags:
 
``` python
lammps_job.potential = cu_ace_potential
```
 
%% Cell type:code id: tags:
 
``` python
lammps_job.structure = test_pr.create.structure.ase_bulk("Cu","fcc",cubic=True)
```
 
%% Cell type:code id: tags:
 
``` python
lammps_job.calc_minimize(pressure=0.0)
```
 
%% Cell type:code id: tags:
 
``` python
lammps_job.run()
```
 
%% Output
 
The job opt_lammps was saved and received the ID: 290
 
%% Cell type:code id: tags:
 
``` python
test_pr.job_table()
```
 
%% Output
 
id status chemicalformula job subjob \
0 290 finished Cu4 opt_lammps /opt_lammps
projectpath \
0 /home/yury/PycharmProjects/pyiron-2021/
project \
0 pyiron_potentialfit/day_2/03-ace/test_ace_potential/
timestart timestop totalcputime \
0 2021-03-08 17:52:19.328134 2021-03-08 17:52:20.225226 0.0
computer hamilton hamversion parentid masterid
0 pyiron@dell-inspiron#1 Lammps 0.1 None None
 
%% Cell type:markdown id: tags:
 
## E-V curve
 
%% Cell type:code id: tags:
 
``` python
ev_job = test_pr.create.job.Murnaghan("murn", delete_existing_job=True)
```
 
%% Cell type:code id: tags:
 
``` python
ref_job = test_pr.create.job.Lammps("ref_job", delete_existing_job=True)
```
 
%% Cell type:code id: tags:
 
``` python
ref_job.potential = cu_ace_potential
```
 
%% Cell type:code id: tags:
 
``` python
ref_job.structure = lammps_job.get_structure()
```
 
%% Cell type:code id: tags:
 
``` python
ev_job.ref_job = ref_job
```
 
%% Cell type:code id: tags:
 
``` python
ev_job.run()
```
 
%% Output
 
The job murn was saved and received the ID: 291
The job strain_0_9 was saved and received the ID: 292
The job strain_0_92 was saved and received the ID: 293
The job strain_0_94 was saved and received the ID: 294
The job strain_0_96 was saved and received the ID: 295
The job strain_0_98 was saved and received the ID: 296
The job strain_1_0 was saved and received the ID: 297
The job strain_1_02 was saved and received the ID: 298
The job strain_1_04 was saved and received the ID: 299
The job strain_1_06 was saved and received the ID: 300
The job strain_1_08 was saved and received the ID: 301
The job strain_1_1 was saved and received the ID: 302
job_id: 292 finished
job_id: 293 finished
job_id: 294 finished
job_id: 295 finished
job_id: 296 finished
job_id: 297 finished
job_id: 298 finished
job_id: 299 finished
job_id: 300 finished
job_id: 301 finished
job_id: 302 finished
 
%% Cell type:code id: tags:
 
``` python
ev_job.plot()
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
ev_job["output/equilibrium_bulk_modulus"]
```
 
%% Output
 
159.1806540485084
 
%% Cell type:code id: tags:
 
``` python
ev_job["output/equilibrium_b_prime"]
```
 
%% Output
 
4.3113630248310635
 
%% Cell type:code id: tags:
 
``` python
ev_job["output/equilibrium_energy"]/4
```
 
%% Output
 
-3.7003977945319573
 
%% Cell type:code id: tags:
 
``` python
ev_job["output/equilibrium_volume"]/4
```
 
%% Output
 
11.972878760885306
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:markdown id: tags:
 
# Advanced (already trained) potential
 
%% Cell type:markdown id: tags:
 
More advanced Cu potential trained on `df3` and longer range (`cutoff=7.5`)
 
%% Cell type:code id: tags:
 
``` python
advanced_potential = BBasisConfiguration("good_potentials/df3_cut75_large_body_order.yaml")
```
 
%% Cell type:code id: tags:
 
``` python
advanced_basis_set = ACEBBasisSet(advanced_potential)
```
 
%% Cell type:markdown id: tags:
 
For single-species potential there is only one **species block** for *Cu*:
 
%% Cell type:code id: tags:
 
``` python
len(advanced_potential.funcspecs_blocks)
```
 
%% Output
 
1
 
%% Cell type:code id: tags:
 
``` python
Cu_block = advanced_potential.funcspecs_blocks[0]
```
 
%% Cell type:markdown id: tags:
 
radial coefficients $c_{nlk}$:
 
%% Cell type:code id: tags:
 
``` python
np.shape(Cu_block.radcoefficients)
```
 
%% Output
 
(4, 5, 15)
 
%% Cell type:code id: tags:
 
``` python
print("Cutoff: ",Cu_block.rcutij, " Ang")
```
 
%% Output
 
Cutoff: 7.5 Ang
 
%% Cell type:markdown id: tags:
 
Visualize the radial basis functions ($g_k$) and radial functions ($R_{nl}$) and their derivatives:
 
%% Cell type:code id: tags:
 
``` python
RadialFunctionsVisualization(advanced_basis_set).plot()
```
 
%% Output
 
 
%% Cell type:markdown id: tags:
 
Total number of basis functions
 
%% Cell type:code id: tags:
 
``` python
len(Cu_block.funcspecs)
```
 
%% Output
 
208
 
%% Cell type:markdown id: tags:
 
List of B-basis functions $ {B}_{i\pmb{\mu n l L}}$: $\pmb{\mu} = $ `elements`, $\pmb{n} = $ `ns`, $\pmb{l} = $ `ls`, $\pmb{L} = $ `LS`) and corresponding coefficients $ {c}^{(p)}_{\mu_i\pmb{\mu n l L}} =$ `coeffs` for two densities
 
%% Cell type:markdown id: tags:
 
first 20 B-functions
 
%% Cell type:code id: tags:
 
``` python
Cu_block.funcspecs[:20]
```
 
%% Output
 
[BBasisFunctionSpecification(elements=[Al,Al], ns=[1], ls=[0], coeffs=[0.778052,-0.641316]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[2], ls=[0], coeffs=[2.23777,0.156201]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[3], ls=[0], coeffs=[4.43693,-0.13343]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[4], ls=[0], coeffs=[1.47578,-1.28301]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[5], ls=[0], coeffs=[-2.59834,-1.53179]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[6], ls=[0], coeffs=[-1.69264,0.330513]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[7], ls=[0], coeffs=[1.43426,2.03646]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[8], ls=[0], coeffs=[0.770394,0.734637]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[9], ls=[0], coeffs=[-1.5626,-1.94086]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[10], ls=[0], coeffs=[-0.302523,-1.69641]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[11], ls=[0], coeffs=[1.56285,1.38751]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[12], ls=[0], coeffs=[-0.55265,2.25767]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[13], ls=[0], coeffs=[-1.30788,-0.708937]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[14], ls=[0], coeffs=[1.63759,-2.00429]),
BBasisFunctionSpecification(elements=[Al,Al], ns=[15], ls=[0], coeffs=[-0.703138,1.26224]),
BBasisFunctionSpecification(elements=[Al,Al,Al], ns=[1,1], ls=[0,0], coeffs=[-0.0151471,0.0245058]),
BBasisFunctionSpecification(elements=[Al,Al,Al], ns=[1,1], ls=[1,1], coeffs=[0.00809464,0.133587]),
BBasisFunctionSpecification(elements=[Al,Al,Al], ns=[1,1], ls=[2,2], coeffs=[-0.00675808,-0.00741527]),
BBasisFunctionSpecification(elements=[Al,Al,Al], ns=[1,1], ls=[3,3], coeffs=[0.000552032,-0.0112879]),
BBasisFunctionSpecification(elements=[Al,Al,Al], ns=[1,1], ls=[4,4], coeffs=[-0.000231509,-0.00476812])]
 
%% Cell type:markdown id: tags:
 
last 20 B-functions
 
%% Cell type:code id: tags:
 
``` python
Cu_block.funcspecs[-20:]
```
 
%% Output
 
[BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[2,1,1], LS=[1], coeffs=[-0.0108445,0.0344024]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[2,2,0], LS=[0], coeffs=[0.00323158,0.229271]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[2,2,2], LS=[2], coeffs=[-0.000115442,0.0766528]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[3,2,1], LS=[1], coeffs=[0.00202504,-0.0988705]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[3,3,0], LS=[0], coeffs=[-0.00468792,0.125821]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,2], ls=[3,3,2], LS=[2], coeffs=[0.00633233,-0.0604226]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[0,0,0], LS=[0], coeffs=[-0.00257037,0.0733903]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[1,1,0], LS=[0], coeffs=[0.0269804,0.496832]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[2,1,1], LS=[1], coeffs=[-0.0389079,0.344705]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[2,2,0], LS=[0], coeffs=[-0.01581,0.418819]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[2,2,2], LS=[2], coeffs=[-0.00142522,-0.0231997]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[3,2,1], LS=[1], coeffs=[-0.0292446,0.0184941]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[3,3,0], LS=[0], coeffs=[-0.0162695,-0.0196287]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al], ns=[3,3,3], ls=[3,3,2], LS=[2], coeffs=[0.0182932,-0.65958]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al], ns=[1,1,1,1], ls=[0,0,0,0], LS=[0,0], coeffs=[6.43545e-07,4.05521e-05]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al], ns=[1,1,1,1], ls=[1,1,0,0], LS=[0,0], coeffs=[5.19403e-06,9.87758e-05]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al], ns=[1,1,1,1], ls=[1,1,1,1], LS=[0,0], coeffs=[2.15772e-06,-0.000101061]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al,Al], ns=[1,1,1,1,1], ls=[0,0,0,0,0], LS=[0,0,0], coeffs=[-1.66834e-09,-6.00712e-07]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al,Al], ns=[1,1,1,1,1], ls=[1,1,0,0,0], LS=[0,0,0], coeffs=[-2.1876e-08,-3.14206e-06]),
BBasisFunctionSpecification(elements=[Al,Al,Al,Al,Al,Al], ns=[1,1,1,1,1], ls=[1,1,1,1,0], LS=[0,0,0], coeffs=[3.28251e-08,-4.23939e-06])]
 
%% Cell type:code id: tags:
 
``` python
print("Trainable parameters number")
print()
print("B-functions coefficients: ",Cu_block.ndensityi * len(Cu_block.funcspecs))
print("Radial functions coefficients: ",len(np.array(Cu_block.radcoefficients).flatten()))
print("-"*40)
print("Total number of trainable parameters: ",len(advanced_potential.get_all_coeffs()))
```
 
%% Output
 
Trainable parameters number
B-functions coefficients: 416
Radial functions coefficients: 300
----------------------------------------
Total number of trainable parameters: 716
 
%% Cell type:code id: tags:
 
``` python
```
......
Supports Markdown
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