Scratch / Tmp
=============
###### tags: `scratch`, `tmp`, `chapter`, `by-wasmer`, `public`, `from-2020-10`, `evolving`, `aiida`, `AI`, `ML`, `KKR`
[up <i class="fa fa-arrow-up"></i> Scratch notebooks](https://iffmd.fz-juelich.de/WxOZ75GTTHu2MNmnw2u5pA#Scratch-notebooks)
Tmp / scratch notebook stuff, ordered by date.
## Table of Contents
[TOC]
## 2022-06-30 YR Meeting
### 2022-06-30 YR Meeting - iffMD presentation wasmer
**Markdown** is the de facto text/document format for the Web. Supports styling, math, media, extensions.
**[iffMD](https://iffmd.fz-juelich.de/)** is the PGI's / FZJ collaborative Markdown editor.
Show my iffMD startup page > switch to Intro
Show [pgi-jcns.fz-juelich.de](https://pgi-jcns.fz-juelich.de/portal/) > Topics > Collaboration Tools > iffMD
Background info: iffMD is the PGI's version of CodiMD, an open-source markdown
editor based on the commercial HackMD. So, if you need to know whether iffMD can
do a certain thing, search also for CodiMD. [CodiMD
docs](https://hackmd.io/c/codimd-documentation/).
-----
How I use iffMD for myself.
Show tag system > minutes, minutes young researchers
Show Book > IT, AiiDA, ML resources
Show downwards / upwards, crosslink
Show revisions
Show rights access
-----
YR minutes - How to add a meeting minutes
- create new notebook
- change access to 'Limited'
- write minutes
- integrate into YR minutes history
- visit [YR meeting minutes overview page](https://iffmd.fz-juelich.de/ymYfDgSJRt6NjWthSI-oEg)
- copy header from previous minutes notebook
- add link to new notebook in overview table. use tabs / graphical editor
## 2021-09-12
tags: TODO
### similarities to `cmlkit` project
The [cmlkit project](https://iffmd.fz-juelich.de/68Vn-YcuSWCun3bL_rJHXA?both#General) by Marcel Langer at FHI for NOMAD Lab has some similarities to my thesis. But cmlkit only allows scalar. The tutorial notebook (see link) shows SOAP KKR regression, and hyperoptimization example for 2400 oxide materials. The [repbench project results](https://marcel.science/repbench/#summary) compare SOAP, ACSF, MBTR for KKR regression and have some interesting results which I should cite in related work or motivation of representation choice!
## 2021-09-02
tags: TODO
### multi-task learning
the term for the problem of learning a vector-valued / array / continuous / multi-dimensional / high-dimensional ... label / target / output / property ... is often called multi-target learning / multi-output learning in ML literature it seems.
- [machinelearningmastery.com - How to Develop Multi-Output Regression Models with Python](https://machinelearningmastery.com/multi-output-regression-models-with-python/)
- [gsearch: multi-task learning](https://www.google.com/search?channel=fs&client=ubuntu&q=multi-task+learning)
- [practicalcheminformatics - multiclass-classification](https://patwalters.github.io/practicalcheminformatics/jupyter/multiclass/pubchem/imbalanced/2021/08/28/multiclass-classification.html#Calculate-molecular-descriptors)
- [gsearch: multi output regression](https://www.google.com/search?q=multi+output+regression&client=ubuntu&hs=Vql&channel=fs&sxsrf=AOaemvIdt2sVMRILUHot6GNkVOLuPki2jg%3A1630571411518&ei=k4swYceLH5GbkgWU9ZawCw&oq=machine+learning+multidimensional+output&gs_lcp=Cgdnd3Mtd2l6EAEYAjIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIRCAAQsAMQigMQtwMQ1AMQ5QIyDggAELADEIoDELcDEOUCSgQIQRgAUABYAGC6oEBoAXACeACAAQCIAQCSAQCYAQDIAQrAAQE&sclient=gws-wiz)
- [gsearch: supervised learning of high-dimensional output](https://www.google.com/search?q=supervised+learning+of+high-dimensional+output&client=ubuntu&hs=WT6&channel=fs&sxsrf=AOaemvLNwKwfDAzG2a0I1EzMGDjdc4R2Vw%3A1630571269992&ei=BYswYeT3O5L-sAeYmpLYCA&oq=supervised+learning+of+high-dimensional+output&gs_lcp=Cgdnd3Mtd2l6EAMyBQghEKABOgcIABBHELADOhEIABCwAxCKAxC3AxDUAxDlAjoGCAAQFhAeOggIIRAWEB0QHjoHCCEQChCgAUoECEEYAFCN2QFYy_oBYJH8AWgBcAJ4AYAB0AGIAe8QkgEGMTcuNS4xmAEAoAEByAEKwAEB&sclient=gws-wiz&ved=0ahUKEwikjtCq79_yAhUSP-wKHRiNBIsQ4dUDCA4&uact=5)
- [gsearch: machine learning multidimensional output](https://www.google.com/search?channel=fs&client=ubuntu&q=machine+learning+multidimensional+output)
- [gsearch: predicting a vector-valued output]()
- zotero (personal):
- [Survey on Multi-Output Learning](https://ieeexplore.ieee.org/abstract/document/8892612)
- [A survey on multi-output regression](https://wires.onlinelibrary.wiley.com/doi/full/10.1002/widm.1157) (on [microsoft academic](https://academic.microsoft.com/paper/2122347864))
- recoll (personal):
- "multi-output"
- Schütt et al., ML meet Quantum Physics > p.140 "7.4.3 Constructing Conservative Vector-Valued GPs" (online: [Accurate Molecular Dynamics Enabled by Efficient Physically Constrained Machine Learning Approaches](https://link.springer.com/chapter/10.1007/978-3-030-40245-7_7)). See also the references for this section. E.g. [Multi-output learning via spectral filtering](https://link.springer.com/article/10.1007/s10994-012-5282-y) is often mentioned, but also others.
- unsorted:
- https://datascience.stackexchange.com/questions/16890/neural-network-for-multiple-output-regression
### Representation of radial potential with basis coefficients
micha's idea of representing the potential function via coefficients in a suitable function basis.
General
- [wiki > Approximation theory](https://en.wikipedia.org/wiki/Approximation_theory): Fourier series, Chebyshev polynomials, ...
Fourier series
- [SE > "Every function can be represented as a Fourier series"?](https://math.stackexchange.com/questions/1378633/every-function-can-be-represented-as-a-fourier-series)
Coding / Python
- [gsearch > python fourier series fit](https://www.google.com/search?channel=fs&client=ubuntu&q=python+fourier+series+fit)
- [towardsdatascience.com > Improve regression via fourier transform](https://towardsdatascience.com/how-to-add-fourier-terms-to-your-regression-seasonality-analysis-using-python-scipy-99a94d3ae51). For periodic signals. How to FT a function and incorporate FT parameters into regression.
- `symfit` example: Fourier series [SE](https://stackoverflow.com/a/52555801/8116031), [RTD](https://symfit.readthedocs.io/en/stable/examples/ex_fourier_series.html).
## 2021-06-03
tags: TODO
### from dimred to feature learning
- from [den-SNE / densMAP](http://cb.csail.mit.edu/cb/densvis/) > [wiki > dimensionality redcuction](https://en.wikipedia.org/wiki/Dimensionality_reduction) and [wiki > nonlinear dimensionality reduction](https://en.wikipedia.org/wiki/Nonlinear_dimensionality_reduction) > to ...
- [feature extraction](https://en.wikipedia.org/wiki/Feature_extraction) means Data -> X, is closely related to dimensionality reduction, and is the umbrella term for subdisciplines
- [feature selection](https://en.wikipedia.org/wiki/Feature_selection) so no trafo, just picking out the relevant ones and discarding the rest
- [feature engineering](https://en.wikipedia.org/wiki/Feature_engineering) manual feature extraction
- [feature learning](https://en.wikipedia.org/wiki/Feature_learning) automatic feature extraction
- all of them, from dimred to feature learning, point to [autoencoders](https://en.wikipedia.org/wiki/Autoencoder) as (deep) dimred technique / feature learner.
## 2021-03-31
tags: TODO
### voronoi descriptor
via
https://workshop.materialsproject.org/lessons/08_ml_matminer/matminer-notes/#conversion-featurizers > https://hackingmaterials.lbl.gov/matminer/featurizer_summary.html#features-from-individual-sites-in-a-material-s-crystal-structure > https://www.google.com/search?channel=fs&client=ubuntu&q=VoronoiFingerprint > https://matsci.org/t/cannot-apply-featurize-dataframe-with-voronoifingerprint-averagebondlength-or-averagebondangle/3141/4 > https://github.com/hackingmaterials/matminer_examples/blob/main/matminer_examples/machine_learning-nb/voronoi-ward-prb-2017.ipynb > https://journals.aps.org/prb/abstract/10.1103/PhysRevB.96.024104#fulltext
### validation set, test set
wikipedia [training, validation, and test sets](https://en.wikipedia.org/wiki/Training,_validation,_and_test_sets).
raschka [how to evaluate a model](https://sebastianraschka.com/faq/docs/evaluate-a-model.html):
single model: test set, multiple models: validation set (find best model / tune hyperparameters), test set (evaluate best model).
cross validation, one model: k-fold cross validation: split data into k sets ('splits'), use k-1 as training data, last split as test data. shuffle, repeat k times. [matminer example](https://workshop.materialsproject.org/lessons/08_ml_matminer/matminer-notes/#cross-validation).
raschka above: nested cross validation for multiple models.
### machine learning potentials
seko 2020 [Machine Learning Potential Repository](https://arxiv.org/abs/2007.14206)
behler 2016 [Perspective: Machine learning potentials for atomistic simulations ](https://aip.scitation.org/doi/full/10.1063/1.4966192)
### ase
[ase general concepts](https://www.scm.com/doc/Scripting/ASE/General_ASE_concepts.html)
## 2021-01-13
tags: TODO
- wrt scaling structures for generating variance: simply change `ALATBASIS`, or need to adjust structure as well? in latter case, how to do that? ideas:
- [pymatgen SuperCellTransformation](https://pymatgen.org/pymatgen.transformations.standard_transformations.html#pymatgen.transformations.standard_transformations.SupercellTransformation):
> scaling_matrix – A matrix of transforming the lattice vectors. Defaults to the identity matrix. Has to be all integers. e.g., [[2,1,0],[0,3,0],[0,0,1]] generates a new structure with lattice vectors a” = 2a + b, b” = 3b, c” = c where a, b, and c are the lattice vectors of the original structure.
- [pymatgen CifTransmuter](https://github.com/materialsproject/pymatgen/blob/v2020.12.31/pymatgen/alchemy/transmuters.py#L252-L317)
- answer: no. the effect of this transformations can be visually explored with the [MaterialsProject Crystal Toolkit](https://materialsproject.org/#apps/xtaltoolkit). At the least the `SupercellTransformation` above is not scaling the lattice constants, just making the cell bigger to include more lattice points.
## 2020-12-28 Learning vscode
tags: TODO
- 201228
- gsearch: vscode most essential extensions
- https://blog.bitsrc.io/16-unique-vscode-extensions-every-developer-should-have-in-2020-c4dcdb74506a
- https://hackernoon.com/24-coolest-vscode-extensions-that-will-rock-your-world-xpi3t0j
- https://github.com/viatsko/awesome-vscode#migrating-from-intellij-idea
- Keybindings for Migrating from Intellij IDEA https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
- https://www.vscodecandothat.com/
- 201226
- vscode supports remote development https://code.visualstudio.com/docs/remote/ssh
## 2020-11-xx plotting the kkr potential
tags: TODO
### References
[jukkr-wiki](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/home)
- [[jukkr_potential-file]](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/potential_file): description of the jukkr potential file format.
- [[jukkr_inputcard]](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/inputcard_codewords): description of all jukkr variables
Note: the 'potential_file' references is a bit hidden buried deep:
- [jukkr-wiki](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/home)
- KKRnano program
- [Source and main files](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/kkrnano/prepare)
- [formatted_potential](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/kkrnano/Formatted_potential)
- [potential_file](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/potential_file)
- [kkrnano/shapefun](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/kkrnano/shapefun)
Notes on [[jukkr_potential-file]](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/potential_file)
### from ruess 201113
- zeller section unpublished
### links laptop 201117
jukkr wiki important sites
- https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/potential_file
- https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/inputcard_codewords
aiida-kkr methods
- https://github.com/JuDFTteam/aiida-kkr/blob/master/aiida_kkr/tools/plot_kkr.py aiida-kkr plotting functions
- https://github.com/JuDFTteam/aiida-kkr/blob/master/aiida_kkr/tools/tools_kkrimp.py = aiida-kkr version of `modify_potential.py`, use for reading potential I/O files
masci-tools methods
- https://github.com/JuDFTteam/masci-tools/tree/master/masci_tools/vis jukkr plotting functions, for example:
- https://github.com/JuDFTteam/masci-tools/blob/master/masci_tools/vis/kkr_plot_shapefun.py
aiida doc
- https://aiida.readthedocs.io/projects/aiida-core/en/latest/
- https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/tutorial.html
- https://aiida-kkr.readthedocs.io/en/stable/user_guide/calculations.html#voronoi-starting-potential-generator
### links 201118
- old latex manual of jukkr. explains what voronoi code does! https://iffgit.fz-juelich.de/kkr/jukkr/-/blob/master/docs/KKRhost_manual_old_tex/kkrmanualMar02.tex
- http://imel.demokritos.gr/~npapanik/kkrmanualMar02/node9.html
-
- from mozumder:
- Zeller 1991: Calculation of shape-truncation functions forVoronoi polyhedra https://iopscience.iop.org/article/10.1088/0953-8984/3/39/006/pdf
- Zeller 1990: An efficient numerical method to calculate shape truncation functions for Wigner-Seitz atomic polyhedra https://www.sciencedirect.com/science/article/pii/001046559090009P see also desktop
## 2020-10-19
tags: TODO
### 201019 `voronoi`, `kkrhost`
- `kkrhost` inputcard keywords `IMIX`, `STRMIX`, `BRYMIX`: mix/mixing potential (simple/linear, Anderson, Broyden) http://www.physics.metu.edu.tr/~hande/teaching/741-lectures/lecture-10.pdf
### 201018 sync firefox
- for sync laptop <-> fzj pc https://support.mozilla.org/en-US/kb/how-do-i-set-sync-my-computer
### 201015 misc
Notation: KKR uppercase = the method, kkrX lowercase = jukkr code X.
#### rwth cluster access
- info for project members https://help.itc.rwth-aachen.de/service/rhr4fjjutttf/article/cc9195394970484ea272fbe0c76d7c59/
- connect to cluster https://help.itc.rwth-aachen.de/service/rhr4fjjutttf/article/cd350ff0de1f460bac545b6cde32e8a7/
- VPN module https://help.itc.rwth-aachen.de/service/vbf6fx0gom76/article/b03171bffec249af9a062cbbdc58b34a/
#### kkrhost basics
- kkrhost inputcard_codewords https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/inputcard_codewords
#### reading mavro
##### mavro-s2-green
- scattering S-matrix (similar to KKR T-matrix, the relation btw perturbed and unperturbed system) https://en.wikipedia.org/wiki/S-matrix#Motivation
- Lippmann-Schwinger equation https://en.wikipedia.org/wiki/Lippmann%E2%80%93Schwinger_equation
- gsearch 'Dyson equation' https://www.google.com/search?client=firefox-b-e&q=dyson+equation
- TU Wien Diss Mahdi Pourfath Chapter 3 Quantum Transport Models **very good, like CMbP L9!** (MBPT, diagrammatic methods)
- Dyson equation https://www.iue.tuwien.ac.at/phd/pourfath/node46.html
- Self-energy and the Dyson equation https://link.springer.com/chapter/10.1007/978-3-319-93602-4_8
##### mavro-s3-sisca
- (gsearch 'Fermi energy crystal' https://tinyurl.com/y63d9rjr )
- gsearch 'Friedel sum rule' $Z_{imp} - Z_{host}$ https://www.google.com/search?client=firefox-b-e&q=friedel+sum+rule
- **read this!** Friedel sum rule and phase shifts https://thiscondensedlife.wordpress.com/2016/08/04/friedel-sum-rule-and-phase-shifts/
- screening QM https://en.wikipedia.org/wiki/Electric-field_screening#Many-body_theory
##### mavro-s4-musca
- gsearch 'Gaunt coefficient' for outgoing wave expansion coefficients https://tinyurl.com/y2caeygh
- (Spin-orbit coupling https://en.wikipedia.org/wiki/Angular_momentum_coupling#Spin%E2%80%93orbit_coupling)
##### mavro-s10-scf
### 201014 kkr theory basics: main references
- mavro = mavropoulos KKR intro https://core.ac.uk/download/pdf/34930703.pdf . Sections references:
- mavro-s1-hist
- mavro-s2-green
- mavro-s3-sisca
- mavro-s4-musca
- mavro-s5-kkrgreen
- mavro-s6-fullpot
- mavro-s7-toten
- mavro-s8-screen
- mavro-s9-2dsys
- mavro-s10-scf
- zimmermann diss cha2 https://publications.rwth-aachen.de/record/459420/files/5217.pdf
### 201014 fzj events
- max center of exascale fleur overview http://www.max-centre.eu/webinar/all-electron-dft-using-fleur-code
### 2020-10-19 `voronoi` & `kkrhost` example1 bulk Cu fcc
#### my newbie mistakes/errors
- mistake01: linux symbolic links: when you do `ln -s a b` (`a`=origin, `b`=destination/symlink to `a`) **twice**, then
- IF `a` is a file, then it will fail with error message
- IF `a` is a dir, then it will silently create a self-referential link to `a` **inside** `a`.
The latter even works if `a` is a nested symlink to a directory.
```
> ls -l && ls -l a
a
foo.txt
> ln -s a b && ln -s a b
> ls -l && ls -l a
a
a
foo.txt
# tab completion:
./a/a/a/a/a/a/a/...
```
**Morale**: when you create a symlink to a directory, **always** check first if that symlink already *exists*.
**The correct way to symlink `ElementDatabase` directory**: reference [jukkr Wiki > FAQ]()
- mistake02: copied erroneous fcc `BRAVAIS` matrix (one entry in matrix was `0.0` instead of `0.5`). Probably also lead to `VERTEX3D: Error` (and too large cluster size `CLS` 140 intead of 70).
- mistake03: executables don't take input file as `argc`, but instead take no args and expect presence of input files with fixed names `inputcard` (voronoi, kkrhost) and `potential`, `shapefun` (attention: output potential file of kkrhost is still `out_potential`, like with voronoi)
- mistake04: inputcard comments: no comment prefix notation (like e.g. `#` or `!!!`) exists, io reader only reacts to keywords and what comes after it (assume case-insensitive). so a 'comment' with a keyword in it will produce an error
#### Rundown of `voronoi` & `kkrhost` output with ruess
#### tmp links
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/Density_of_states
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/inputcard_codewords
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/potential_file
https://iffgit.fz-juelich.de/kkr/jukkr/-/blob/master/source/voronoi/inputcard_example
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/standard_input_file
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/examples_and_tips
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/voronoi/voronoi_program
https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/output_000
## 2020-10-15
tags: TODO
### KKR Theory
Quote:
> After reading these the main parameter controlling the behavior and accuracy of the KKR method, i.e.
> * multiple scattering expansion of the Green function
> * atom centered radial grid and shape function expansion
> * lmax cutoff
> * screening cluster size (tight-binding KKR) of reference system
> * complex energy contour integration
Q: @rues: Answers to abvoe in your own words (to hasten my understanding)?
Other questions:
- Q: wrt Accuracy parameters:
- Q: `LMAX` is the 'resolution' of the SH basis (->accuracy), right?
- Q: `NSPIN`: what are spin channels? A [linear spin chain](https://spie.org/news/4596-quantum-communication-with-a-spin-chain?SSO=1)?
- A: JW: Quote from _codewords_: "Number of spin directions in potential. Values 1 or 2".
- Q: `RCLUSTZ`: how does screening cluster size affect accuracy?
- Q: some words on radial mesh/grid?
-
Wrt [KKR introduction by Ph. Mavropoulos](https://core.ac.uk/download/pdf/34930703.pdf):
### `jukkr` usage
- Q: Location where all input vars are listed? Examples: `ALATBASIS BRAVAIS NAEZ <RBASIS> NSPIN LMAX EMIN RMAX GMAX`, ...
- A: JW: here: [inputcard_codewords](https://iffgit.fz-juelich.de/kkr/jukkr/-/wikis/jumu/inputcard_codewords). Use Ctrl+F.
### admin
only if time (can answer myself)
- ssh:
- `-Y` possible?
- GUI filecopy via double ssh (fish)?
-
- eduroam: unstable? VPN->no connection?
A: potential file parameters for voronoi decomp