├── .clang-format ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── docs ├── requirements.txt └── source │ ├── _static │ ├── hehe │ └── mathjax │ │ ├── a11y │ │ ├── assistive-mml.js │ │ ├── complexity.js │ │ ├── explorer.js │ │ ├── semantic-enrich.js │ │ └── sre.js │ │ ├── adaptors │ │ └── liteDOM.js │ │ ├── core.js │ │ ├── input │ │ ├── asciimath.js │ │ ├── mml.js │ │ ├── mml │ │ │ ├── entities.js │ │ │ └── extensions │ │ │ │ ├── mml3.js │ │ │ │ └── mml3.sef.json │ │ ├── tex-base.js │ │ ├── tex-full.js │ │ ├── tex.js │ │ └── tex │ │ │ └── extensions │ │ │ ├── action.js │ │ │ ├── all-packages.js │ │ │ ├── ams.js │ │ │ ├── amscd.js │ │ │ ├── autoload.js │ │ │ ├── bbox.js │ │ │ ├── boldsymbol.js │ │ │ ├── braket.js │ │ │ ├── bussproofs.js │ │ │ ├── cancel.js │ │ │ ├── cases.js │ │ │ ├── centernot.js │ │ │ ├── color.js │ │ │ ├── colortbl.js │ │ │ ├── colorv2.js │ │ │ ├── configmacros.js │ │ │ ├── empheq.js │ │ │ ├── enclose.js │ │ │ ├── extpfeil.js │ │ │ ├── gensymb.js │ │ │ ├── html.js │ │ │ ├── mathtools.js │ │ │ ├── mhchem.js │ │ │ ├── newcommand.js │ │ │ ├── noerrors.js │ │ │ ├── noundefined.js │ │ │ ├── physics.js │ │ │ ├── require.js │ │ │ ├── setoptions.js │ │ │ ├── tagformat.js │ │ │ ├── textcomp.js │ │ │ ├── textmacros.js │ │ │ ├── unicode.js │ │ │ ├── upgreek.js │ │ │ └── verb.js │ │ ├── latest.js │ │ ├── loader.js │ │ ├── mml-chtml.js │ │ ├── mml-svg.js │ │ ├── node-main.js │ │ ├── output │ │ ├── chtml.js │ │ ├── chtml │ │ │ └── fonts │ │ │ │ ├── tex.js │ │ │ │ └── woff-v2 │ │ │ │ ├── MathJax_AMS-Regular.woff │ │ │ │ ├── MathJax_Calligraphic-Bold.woff │ │ │ │ ├── MathJax_Calligraphic-Regular.woff │ │ │ │ ├── MathJax_Fraktur-Bold.woff │ │ │ │ ├── MathJax_Fraktur-Regular.woff │ │ │ │ ├── MathJax_Main-Bold.woff │ │ │ │ ├── MathJax_Main-Italic.woff │ │ │ │ ├── MathJax_Main-Regular.woff │ │ │ │ ├── MathJax_Math-BoldItalic.woff │ │ │ │ ├── MathJax_Math-Italic.woff │ │ │ │ ├── MathJax_Math-Regular.woff │ │ │ │ ├── MathJax_SansSerif-Bold.woff │ │ │ │ ├── MathJax_SansSerif-Italic.woff │ │ │ │ ├── MathJax_SansSerif-Regular.woff │ │ │ │ ├── MathJax_Script-Regular.woff │ │ │ │ ├── MathJax_Size1-Regular.woff │ │ │ │ ├── MathJax_Size2-Regular.woff │ │ │ │ ├── MathJax_Size3-Regular.woff │ │ │ │ ├── MathJax_Size4-Regular.woff │ │ │ │ ├── MathJax_Typewriter-Regular.woff │ │ │ │ ├── MathJax_Vector-Bold.woff │ │ │ │ ├── MathJax_Vector-Regular.woff │ │ │ │ └── MathJax_Zero.woff │ │ ├── svg.js │ │ └── svg │ │ │ └── fonts │ │ │ └── tex.js │ │ ├── sre │ │ └── mathmaps │ │ │ ├── base.json │ │ │ ├── ca.json │ │ │ ├── da.json │ │ │ ├── de.json │ │ │ ├── en.json │ │ │ ├── es.json │ │ │ ├── fr.json │ │ │ ├── hi.json │ │ │ ├── it.json │ │ │ ├── nb.json │ │ │ ├── nemeth.json │ │ │ ├── nn.json │ │ │ └── sv.json │ │ ├── startup.js │ │ ├── tex-chtml-full-speech.js │ │ ├── tex-chtml-full.js │ │ ├── tex-chtml.js │ │ ├── tex-mml-chtml.js │ │ ├── tex-mml-svg.js │ │ ├── tex-svg-full.js │ │ ├── tex-svg.js │ │ └── ui │ │ ├── lazy.js │ │ ├── menu.js │ │ └── safe.js │ ├── conf.py │ ├── index.rst │ ├── install.rst │ ├── modules.rst │ └── pynep.rst ├── examples ├── C_2022_NEP3.txt ├── PbTe.in ├── README.rst ├── data.traj ├── mutate.py ├── plot_calcefs.py ├── plot_errorvsdistance.py ├── plot_select_structure.py ├── selected.traj ├── shuf_xyz.py ├── test.in └── train.in ├── interface └── lammps │ ├── README.md │ ├── USER-NEP │ ├── install.sh │ ├── pair_NEP.cpp │ └── pair_NEP.h │ └── install.sh ├── nep_cpu ├── CMakeLists.txt ├── build.sh └── src │ ├── dftd3para.h │ ├── nep.cpp │ ├── nep.h │ └── pynep.cpp ├── pynep ├── __init__.py ├── calculate.py ├── io.py ├── mutate.py ├── phono.py └── select.py ├── requirements.txt └── setup.py /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | AlignAfterOpenBracket: AlwaysBreak 3 | AlwaysBreakTemplateDeclarations: Yes 4 | BinPackParameters: false 5 | BreakBeforeBraces: Linux 6 | ColumnLimit: 100 7 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 8 | ConstructorInitializerIndentWidth: 2 9 | ContinuationIndentWidth: 2 10 | IndentCaseLabels: true 11 | PointerAlignment: Left 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User defined 2 | test/ 3 | .vscode 4 | .vs 5 | .history 6 | .VSCodeCounter 7 | examples/* 8 | !examples/*.py 9 | !examples/C_2022_NEP3.txt 10 | !examples/data.traj 11 | !examples/PbTe.in 12 | interface/lammps/USER-NEP/nep.* 13 | # tex info 14 | /docs/**/* 15 | !/docs/requirements.txt 16 | !/docs/source/ 17 | /docs/source/auto_examples/ 18 | # Byte-compiled / optimized / DLL files 19 | __pycache__/ 20 | *.py[cod] 21 | *$py.class 22 | 23 | # C extensions 24 | *.so 25 | *.o 26 | # Distribution / packaging 27 | .Python 28 | build/ 29 | develop-eggs/ 30 | dist/ 31 | downloads/ 32 | eggs/ 33 | .eggs/ 34 | lib/ 35 | lib64/ 36 | parts/ 37 | sdist/ 38 | var/ 39 | wheels/ 40 | share/python-wheels/ 41 | *.egg-info/ 42 | .installed.cfg 43 | *.egg 44 | MANIFEST 45 | 46 | # PyInstaller 47 | # Usually these files are written by a python script from a template 48 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 49 | *.manifest 50 | *.spec 51 | 52 | # Installer logs 53 | pip-log.txt 54 | pip-delete-this-directory.txt 55 | 56 | # Unit test / coverage reports 57 | htmlcov/ 58 | .tox/ 59 | .nox/ 60 | .coverage 61 | .coverage.* 62 | .cache 63 | nosetests.xml 64 | coverage.xml 65 | *.cover 66 | .hypothesis/ 67 | .pytest_cache/ 68 | 69 | # Translations 70 | *.mo 71 | *.pot 72 | 73 | # Django stuff: 74 | *.log 75 | local_settings.py 76 | db.sqlite3 77 | 78 | # Flask stuff: 79 | instance/ 80 | .webassets-cache 81 | 82 | # Scrapy stuff: 83 | .scrapy 84 | 85 | # Sphinx documentation 86 | docs/_build/ 87 | 88 | # PyBuilder 89 | target/ 90 | 91 | # Jupyter Notebook 92 | .ipynb_checkpoints 93 | 94 | # IPython 95 | profile_default/ 96 | ipython_config.py 97 | 98 | # pyenv 99 | .python-version 100 | 101 | # celery beat schedule file 102 | celerybeat-schedule 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pybind11"] 2 | path = pybind11 3 | url = https://gitlab.com/bigd4/pybind11.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 wang laosi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PyNEP 2 | [![Documentation Status](https://readthedocs.org/projects/pynep/badge/?version=latest)](https://pynep.readthedocs.io/en/latest/) 3 | 4 | **[PyNEP](https://pynep.readthedocs.io/en/latest/)** is a python interface of the machine learning potential **NEP** used in **[GPUMD](https://github.com/brucefan1983/GPUMD)**. 5 | ## Features 6 | 7 | - ase calculator of NEP 8 | - descriptor and latent descriptor calculation of atoms 9 | - load and dump for GPUMD dataset 10 | - phonopy calculation of NEP (need phonopy and spglib) 11 | - structures select 12 | + Farthest Point Sampling 13 | ## Installation 14 | 15 | ### Requirements 16 | 17 | 18 | | Package | version | 19 | | ---- | ---- | 20 | | [Python](https://www.python.org/) | >= 3.8 | 21 | | [NumPy](https://docs.scipy.org/doc/numpy/reference/) | >= 2.0 | 22 | |[SciPy](https://docs.scipy.org/doc/scipy/reference/)|>= 1.1| 23 | |[ase](https://wiki.fysik.dtu.dk/ase/index.html)|>= 3.18.0| 24 | 25 | 26 | ### By pip 27 | 28 | ```shell 29 | $ pip install git+https://github.com/bigd4/PyNEP.git 30 | ``` 31 | 32 | ### By setup.py 33 | 34 | ```shell 35 | $ git clone --recursive https://github.com/bigd4/PyNEP.git 36 | $ cd PyNEP 37 | $ python setup.py install 38 | ``` 39 | 40 | ### From Source 41 | 42 | ```shell 43 | $ git clone --recursive https://github.com/bigd4/PyNEP.git 44 | $ cd PyNEP/nep_cpu 45 | $ mkdir build 46 | $ cd build 47 | $ cmake .. && make 48 | $ cp nep.so ../../PyNEP 49 | ``` 50 | 51 | Add `pynep` to your [`PYTHONPATH`](https://wiki.fysik.dtu.dk/ase/install.html#envvar-PYTHONPATH) environment variable in your `~/.bashrc` file. 52 | 53 | ```shell 54 | $ export PYTHONPATH=:$PYTHONPATH 55 | ``` 56 | 57 | ## File format conversion 58 | 59 | ```python 60 | 61 | #For an example of a randomly split training datasets: examples/shuf_xyz.py 62 | 63 | # NEP to exyz 64 | train_data = load_nep("train.in", ftype="nep") 65 | dump_nep("train.xyz", train_data, ftype="exyz") 66 | 67 | # exyz to NEP 68 | train_data = load_nep("train.xyz", ftype="exyz") 69 | dump_nep("train.in", train_data, ftype="nep") 70 | 71 | ``` 72 | 73 | ## Usage 74 | 75 | ```python 76 | from ase.build import bulk 77 | atoms = bulk('C', 'diamond', cubic=True) 78 | 79 | # calculate energy and forces 80 | from pynep.calculate import NEP 81 | calc = NEP('nep.txt') 82 | atoms = bulk('C', 'diamond', cubic=True) 83 | atoms.set_calculator(calc) 84 | energy = atoms.get_potential_energy() 85 | forces = atoms.get_forces() 86 | stress = atoms.get_stress() # stress in ase is different from virial in GPUMD 87 | 88 | # calculate descriptors and latent descriptors 89 | des = calc.get_property('descriptor', atoms) 90 | lat = calc.get_property('latent', atoms) 91 | 92 | # load and dump GPUMD data 93 | from pynep.io import load_nep, dump_nep 94 | dump_nep('C.in', [atoms]) 95 | atoms = load_nep('C.in')[0] 96 | 97 | # calculate band strucuture, dos and thermal properties (need spglib and phonopy) 98 | from pynep.phono import PhonoCalc 99 | phono_calc = PhonoCalc(calc) 100 | phono_calc.calculate(atoms) 101 | ``` 102 | 103 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | recommonmark 2 | sphinx_markdown_tables 3 | sphinx-gallery 4 | scikit-learn 5 | -------------------------------------------------------------------------------- /docs/source/_static/hehe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/hehe -------------------------------------------------------------------------------- /docs/source/_static/mathjax/a11y/assistive-mml.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,i,o={62:function(t,e,i){var o,s=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,o=arguments.length;i0)&&!(o=n.next()).done;)r.push(o.value)}catch(t){s={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(s)throw s.error}}return r},a=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var o,s=0,n=e.length;s=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AssistiveMmlHandler=e.AssistiveMmlMathDocumentMixin=e.AssistiveMmlMathItemMixin=e.LimitedMmlVisitor=void 0;var p=i(769),c=i(433),u=i(77),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getAttributes=function(e){return t.prototype.getAttributes.call(this,e).replace(/ ?id=".*?"/,"")},e}(c.SerializedMmlVisitor);function m(t){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.assistiveMml=function(t,e){if(void 0===e&&(e=!1),!(this.state()>=p.STATE.ASSISTIVEMML)){if(!this.isEscaped&&(t.options.enableAssistiveMml||e)){var i=t.adaptor,o=t.toMML(this.root).replace(/\n */g,"").replace(//g,""),s=i.firstChild(i.body(i.parse(o,"text/html"))),n=i.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[s]);i.setAttribute(i.firstChild(this.typesetRoot),"aria-hidden","true"),i.setStyle(this.typesetRoot,"position","relative"),i.append(this.typesetRoot,n)}this.state(p.STATE.ASSISTIVEMML)}},e}(t)}function M(t){var e;return e=function(t){function e(){for(var e=[],i=0;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,i=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},c=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,a=0,i=e.length;a=u.STATE.ENRICHED)){if(!this.isEscaped&&(t.options.enableEnrichment||n)){t.options.sre.speech!==y&&(y=t.options.sre.speech,h.mathjax.retryAfter(d.default.setupEngine(t.options.sre).then((function(){return d.default.sreReady()}))));var a=new t.options.MathItem("",e);try{var i=this.inputData.originalMml=r(this.root);a.math=this.serializeMml(d.default.toEnriched(i)),a.display=this.display,a.compile(t),this.root=a.root,this.inputData.enrichedMml=a.math}catch(e){t.options.enrichError(t,this,e)}}this.state(u.STATE.ENRICHED)}},n.prototype.attachSpeech=function(t){var e,r;if(!(this.state()>=u.STATE.ATTACHSPEECH)){var n=this.root.attributes.get("aria-label")||this.getSpeech(this.root);if(n){var a=t.adaptor,i=this.typesetRoot;a.setAttribute(i,"aria-label",n);try{for(var s=o(a.childNodes(i)),c=s.next();!c.done;c=s.next()){var l=c.value;a.setAttribute(l,"aria-hidden","true")}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}}this.state(u.STATE.ATTACHSPEECH)}},n.prototype.getSpeech=function(t){var e,r,n=t.attributes;if(!n)return"";var a=n.getExplicit("data-semantic-speech");if(!n.getExplicit("data-semantic-parent")&&a)return a;try{for(var i=o(t.childNodes),s=i.next();!s.done;s=i.next()){var c=s.value,l=this.getSpeech(c);if(null!=l)return l}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return""},n}(t)}function m(t,e){var r;return r=function(t){function r(){for(var r=[],n=0;n":"\u2192","<":"\u2190",V:"\u2193",A:"\u2191"}[a],h=e.GetUpTo(t+a,a),_=e.GetUpTo(t+a,a);if(">"===a||"<"===a){if(s=e.create("token","mo",p,f),h||(h="\\kern "+u.getProperty("minw")),h||_){var x={width:"+.67em",lspace:".33em"};if(s=e.create("node","munderover",[s]),h){var b=new o.default(h,e.stack.env,e.configuration).mml(),v=e.create("node","mpadded",[b],x);l.default.setAttribute(v,"voffset",".1em"),l.default.setChild(s,s.over,v)}if(_){var g=new o.default(_,e.stack.env,e.configuration).mml();l.default.setChild(s,s.under,e.create("node","mpadded",[g],x))}e.configuration.options.amscd.hideHorizontalLabels&&(s=e.create("node","mpadded",s,{depth:0,height:".67em"}))}}else{var C=e.create("token","mo",M,f);s=C,(h||_)&&(s=e.create("node","mrow"),h&&l.default.appendChildren(s,[new o.default("\\scriptstyle\\llap{"+h+"}",e.stack.env,e.configuration).mml()]),C.texClass=i.TEXCLASS.ORD,l.default.appendChildren(s,[C]),_&&l.default.appendChildren(s,[new o.default("\\scriptstyle\\rlap{"+_+"}",e.stack.env,e.configuration).mml()]))}}s&&e.Push(s),c.cell(e,t)},cell:function(e,t){var a=e.stack.Top();(a.table||[]).length%2==0&&0===(a.row||[]).length&&e.Push(e.create("node","mpadded",[],{height:"8.5pt",depth:"2pt"})),e.Push(e.itemFactory.create("cell").setProperties({isEntry:!0,name:t}))},minCDarrowwidth:function(e,t){e.stack.env.CD_minw=e.GetDimen(t)},minCDarrowheight:function(e,t){e.stack.env.CD_minh=e.GetDimen(t)}};t.default=c},955:function(e,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},801:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TEXCLASS=MathJax._.core.MmlTree.MmlNode.TEXCLASS,t.TEXCLASSNAMES=MathJax._.core.MmlTree.MmlNode.TEXCLASSNAMES,t.indentAttributes=MathJax._.core.MmlTree.MmlNode.indentAttributes,t.AbstractMmlNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlNode,t.AbstractMmlTokenNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlTokenNode,t.AbstractMmlLayoutNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlLayoutNode,t.AbstractMmlBaseNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlBaseNode,t.AbstractMmlEmptyNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlEmptyNode,t.TextNode=MathJax._.core.MmlTree.MmlNode.TextNode,t.XMLNode=MathJax._.core.MmlTree.MmlNode.XMLNode},251:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.NodeUtil.default},945:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.ParseMethods.default},871:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseResult=MathJax._.input.tex.SymbolMap.parseResult,t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},193:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.TexParser.default},379:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Other=MathJax._.input.tex.base.BaseConfiguration.Other,t.BaseTags=MathJax._.input.tex.base.BaseConfiguration.BaseTags,t.BaseConfiguration=MathJax._.input.tex.base.BaseConfiguration.BaseConfiguration}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return o[e].call(a.exports,a,a.exports,i),a.exports}e=i(955),t=i(667),a=i(769),r=i(834),MathJax.loader&&MathJax.loader.checkVersion("[tex]/amscd",t.q,"tex-extension"),(0,e.r8)({_:{input:{tex:{amscd:{AmsCdConfiguration:a,AmsCdMethods:r}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/autoload.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,o={667:function(t,e){e.q=void 0,e.q="3.2.2"},275:function(t,e,a){var o=this&&this.__read||function(t,e){var a="function"==typeof Symbol&&t[Symbol.iterator];if(!a)return t;var o,r,n=a.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return i},r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,a=e&&t[e],o=0;if(a)return a.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AutoloadConfiguration=void 0;var n=a(251),i=a(871),l=a(924),u=a(96),p=a(629),c=a(74);function s(t,e,a,n){var i,l,c,s;if(p.Package.packages.has(t.options.require.prefix+a)){var d=t.options.autoload[a],M=o(2===d.length&&Array.isArray(d[0])?d:[d,[]],2),h=M[0],m=M[1];try{for(var y=r(h),b=y.next();!b.done;b=y.next()){var _=b.value;x.remove(_)}}catch(t){i={error:t}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(i)throw i.error}}try{for(var v=r(m),g=v.next();!g.done;g=v.next()){var O=g.value;f.remove(O)}}catch(t){c={error:t}}finally{try{g&&!g.done&&(s=v.return)&&s.call(v)}finally{if(c)throw c.error}}t.string=(n?e+" ":"\\begin{"+e.slice(1)+"}")+t.string.slice(t.i),t.i=0}(0,u.RequireLoad)(t,a)}var x=new i.CommandMap("autoload-macros",{},{}),f=new i.CommandMap("autoload-environments",{},{});e.AutoloadConfiguration=n.Configuration.create("autoload",{handler:{macro:["autoload-macros"],environment:["autoload-environments"]},options:{autoload:(0,c.expandable)({action:["toggle","mathtip","texttip"],amscd:[[],["CD"]],bbox:["bbox"],boldsymbol:["boldsymbol"],braket:["bra","ket","braket","set","Bra","Ket","Braket","Set","ketbra","Ketbra"],bussproofs:[[],["prooftree"]],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","definecolor","textcolor","colorbox","fcolorbox"],enclose:["enclose"],extpfeil:["xtwoheadrightarrow","xtwoheadleftarrow","xmapsto","xlongequal","xtofrom","Newextarrow"],html:["href","class","style","cssId"],mhchem:["ce","pu"],newcommand:["newcommand","renewcommand","newenvironment","renewenvironment","def","let"],unicode:["unicode"],verb:["verb"]})},config:function(t,e){var a,n,i,p,c,d,M=e.parseOptions,h=M.handlers.get("macro"),m=M.handlers.get("environment"),y=M.options.autoload;M.packageData.set("autoload",{Autoload:s});try{for(var b=r(Object.keys(y)),_=b.next();!_.done;_=b.next()){var v=_.value,g=y[v],O=o(2===g.length&&Array.isArray(g[0])?g:[g,[]],2),J=O[0],C=O[1];try{for(var k=(i=void 0,r(J)),q=k.next();!q.done;q=k.next()){var w=q.value;h.lookup(w)&&"color"!==w||x.add(w,new l.Macro(w,s,[v,!0]))}}catch(t){i={error:t}}finally{try{q&&!q.done&&(p=k.return)&&p.call(k)}finally{if(i)throw i.error}}try{for(var S=(c=void 0,r(C)),P=S.next();!P.done;P=S.next()){var R=P.value;m.lookup(R)||f.add(R,new l.Macro(R,s,[v,!1]))}}catch(t){c={error:t}}finally{try{P&&!P.done&&(d=S.return)&&d.call(S)}finally{if(c)throw c.error}}}}catch(t){a={error:t}}finally{try{_&&!_.done&&(n=b.return)&&n.call(b)}finally{if(a)throw a.error}}M.packageData.get("require")||u.RequireConfiguration.config(t,e)},init:function(t){t.options.require||(0,c.defaultOptions)(t.options,u.RequireConfiguration.options)},priority:10})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},74:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.util.Options.isObject,e.APPEND=MathJax._.util.Options.APPEND,e.REMOVE=MathJax._.util.Options.REMOVE,e.OPTIONS=MathJax._.util.Options.OPTIONS,e.Expandable=MathJax._.util.Options.Expandable,e.expandable=MathJax._.util.Options.expandable,e.makeArray=MathJax._.util.Options.makeArray,e.keys=MathJax._.util.Options.keys,e.copy=MathJax._.util.Options.copy,e.insert=MathJax._.util.Options.insert,e.defaultOptions=MathJax._.util.Options.defaultOptions,e.userOptions=MathJax._.util.Options.userOptions,e.selectOptions=MathJax._.util.Options.selectOptions,e.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,e.separateOptions=MathJax._.util.Options.separateOptions,e.lookup=MathJax._.util.Options.lookup},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},924:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Symbol=MathJax._.input.tex.Symbol.Symbol,e.Macro=MathJax._.input.tex.Symbol.Macro},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},96:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.RequireLoad=MathJax._.input.tex.require.RequireConfiguration.RequireLoad,e.RequireMethods=MathJax._.input.tex.require.RequireConfiguration.RequireMethods,e.options=MathJax._.input.tex.require.RequireConfiguration.options,e.RequireConfiguration=MathJax._.input.tex.require.RequireConfiguration.RequireConfiguration},629:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.PackageError=MathJax._.components.package.PackageError,e.Package=MathJax._.components.package.Package}},r={};function n(t){var e=r[t];if(void 0!==e)return e.exports;var a=r[t]={exports:{}};return o[t].call(a.exports,a,a.exports,n),a.exports}t=n(955),e=n(667),a=n(275),MathJax.loader&&MathJax.loader.checkVersion("[tex]/autoload",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{autoload:{AutoloadConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/bbox.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,a,e,o={667:function(t,a){a.q=void 0,a.q="3.2.2"},133:function(t,a,e){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a,"__esModule",{value:!0}),a.BboxConfiguration=a.BboxMethods=void 0;var n=e(251),i=e(871),r=o(e(402));a.BboxMethods={},a.BboxMethods.BBox=function(t,a){for(var e,o,n,i=t.GetBrackets(a,""),l=t.ParseArg(a),x=i.split(/,/),M=0,s=x.length;M=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a,"__esModule",{value:!0}),a.BoldsymbolConfiguration=a.rewriteBoldTokens=a.createBoldToken=a.BoldsymbolMethods=void 0;var r=o(251),i=n(o(748)),l=o(108),s=o(871),u=o(348),d={};function x(t,a,o,e){var n=u.NodeFactory.createToken(t,a,o,e);return"mtext"!==a&&t.configuration.parser.stack.env.boldsymbol&&(i.default.setProperty(n,"fixBold",!0),t.configuration.addNode("fixBold",n)),n}function p(t){var a,o;try{for(var n=e(t.data.getList("fixBold")),r=n.next();!r.done;r=n.next()){var s=r.value;if(i.default.getProperty(s,"fixBold")){var u=i.default.getAttribute(s,"mathvariant");null==u?i.default.setAttribute(s,"mathvariant",l.TexConstant.Variant.BOLD):i.default.setAttribute(s,"mathvariant",d[u]||u),i.default.removeProperties(s,"fixBold")}}}catch(t){a={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(a)throw a.error}}}d[l.TexConstant.Variant.NORMAL]=l.TexConstant.Variant.BOLD,d[l.TexConstant.Variant.ITALIC]=l.TexConstant.Variant.BOLDITALIC,d[l.TexConstant.Variant.FRAKTUR]=l.TexConstant.Variant.BOLDFRAKTUR,d[l.TexConstant.Variant.SCRIPT]=l.TexConstant.Variant.BOLDSCRIPT,d[l.TexConstant.Variant.SANSSERIF]=l.TexConstant.Variant.BOLDSANSSERIF,d["-tex-calligraphic"]="-tex-bold-calligraphic",d["-tex-oldstyle"]="-tex-bold-oldstyle",d["-tex-mathit"]=l.TexConstant.Variant.BOLDITALIC,a.BoldsymbolMethods={},a.BoldsymbolMethods.Boldsymbol=function(t,a){var o=t.stack.env.boldsymbol;t.stack.env.boldsymbol=!0;var e=t.ParseArg(a);t.stack.env.boldsymbol=o,t.Push(e)},new s.CommandMap("boldsymbol",{boldsymbol:"Boldsymbol"},a.BoldsymbolMethods),a.createBoldToken=x,a.rewriteBoldTokens=p,a.BoldsymbolConfiguration=r.Configuration.create("boldsymbol",{handler:{macro:["boldsymbol"]},nodes:{token:x},postprocessors:[p]})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},348:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.NodeFactory=MathJax._.input.tex.NodeFactory.NodeFactory},748:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.NodeUtil.default},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.parseResult=MathJax._.input.tex.SymbolMap.parseResult,a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.TexConstant=MathJax._.input.tex.TexConstants.TexConstant}},n={};function r(t){var a=n[t];if(void 0!==a)return a.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,r),o.exports}t=r(955),a=r(667),o=r(986),MathJax.loader&&MathJax.loader.checkVersion("[tex]/boldsymbol",a.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{boldsymbol:{BoldsymbolConfiguration:o}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/braket.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,r,o,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},243:function(t,e,a){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.BraketConfiguration=void 0;var o=a(251),n=a(519);a(299),e.BraketConfiguration=o.Configuration.create("braket",{handler:{character:["Braket-characters"],macro:["Braket-macros"]},items:(r={},r[n.BraketItem.prototype.kind]=n.BraketItem,r)})},519:function(t,e,a){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BraketItem=void 0;var i=a(76),l=a(801),c=n(a(398)),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"kind",{get:function(){return"braket"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.checkItem=function(e){return e.isKind("close")?[[this.factory.create("mml",this.toMml())],!0]:e.isKind("mml")?(this.Push(e.toMml()),this.getProperty("single")?[[this.toMml()],!0]:i.BaseItem.fail):t.prototype.checkItem.call(this,e)},e.prototype.toMml=function(){var e=t.prototype.toMml.call(this),a=this.getProperty("open"),r=this.getProperty("close");if(this.getProperty("stretchy"))return c.default.fenced(this.factory.configuration,a,e,r);var o={fence:!0,stretchy:!1,symmetric:!0,texClass:l.TEXCLASS.OPEN},n=this.create("token","mo",o,a);o.texClass=l.TEXCLASS.CLOSE;var i=this.create("token","mo",o,r);return this.create("node","mrow",[n,e,i],{open:a,close:r,texClass:l.TEXCLASS.INNER})},e}(i.BaseItem);e.BraketItem=s},299:function(t,e,a){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=a(871),n=r(a(277));new o.CommandMap("Braket-macros",{bra:["Macro","{\\langle {#1} \\vert}",1],ket:["Macro","{\\vert {#1} \\rangle}",1],braket:["Braket","\u27e8","\u27e9",!1,1/0],set:["Braket","{","}",!1,1],Bra:["Macro","{\\left\\langle {#1} \\right\\vert}",1],Ket:["Macro","{\\left\\vert {#1} \\right\\rangle}",1],Braket:["Braket","\u27e8","\u27e9",!0,1/0],Set:["Braket","{","}",!0,1],ketbra:["Macro","{\\vert {#1} \\rangle\\langle {#2} \\vert}",2],Ketbra:["Macro","{\\left\\vert {#1} \\right\\rangle\\left\\langle {#2} \\right\\vert}",2],"|":"Bar"},n.default),new o.MacroMap("Braket-characters",{"|":"Bar"},n.default)},277:function(t,e,a){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(a(360)),n=a(801),i=r(a(402)),l={};l.Macro=o.default.Macro,l.Braket=function(t,e,a,r,o,n){var l=t.GetNext();if(""===l)throw new i.default("MissingArgFor","Missing argument for %1",t.currentCS);var c=!0;"{"===l&&(t.i++,c=!1),t.Push(t.itemFactory.create("braket").setProperties({barmax:n,barcount:0,open:a,close:r,stretchy:o,single:c}))},l.Bar=function(t,e){var a="|"===e?"|":"\u2225",r=t.stack.Top();if("braket"!==r.kind||r.getProperty("barcount")>=r.getProperty("barmax")){var o=t.create("token","mo",{texClass:n.TEXCLASS.ORD,stretchy:!1},a);t.Push(o)}else{if("|"===a&&"|"===t.GetNext()&&(t.i++,a="\u2225"),r.getProperty("stretchy")){var i=t.create("node","TeXAtom",[],{texClass:n.TEXCLASS.CLOSE});t.Push(i),r.setProperty("barcount",r.getProperty("barcount")+1),i=t.create("token","mo",{stretchy:!0,braketbar:!0},a),t.Push(i),i=t.create("node","TeXAtom",[],{texClass:n.TEXCLASS.OPEN}),t.Push(i)}else{var l=t.create("token","mo",{stretchy:!1,braketbar:!0},a);t.Push(l)}}},e.default=l},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},801:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TEXCLASS=MathJax._.core.MmlTree.MmlNode.TEXCLASS,e.TEXCLASSNAMES=MathJax._.core.MmlTree.MmlNode.TEXCLASSNAMES,e.indentAttributes=MathJax._.core.MmlTree.MmlNode.indentAttributes,e.AbstractMmlNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlNode,e.AbstractMmlTokenNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlTokenNode,e.AbstractMmlLayoutNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlLayoutNode,e.AbstractMmlBaseNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlBaseNode,e.AbstractMmlEmptyNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlEmptyNode,e.TextNode=MathJax._.core.MmlTree.MmlNode.TextNode,e.XMLNode=MathJax._.core.MmlTree.MmlNode.XMLNode},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},76:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MmlStack=MathJax._.input.tex.StackItem.MmlStack,e.BaseItem=MathJax._.input.tex.StackItem.BaseItem},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default},360:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.base.BaseMethods.default}},i={};function l(t){var e=i[t];if(void 0!==e)return e.exports;var a=i[t]={exports:{}};return n[t].call(a.exports,a,a.exports,l),a.exports}t=l(955),e=l(667),a=l(243),r=l(519),o=l(277),MathJax.loader&&MathJax.loader.checkVersion("[tex]/braket",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{braket:{BraketConfiguration:a,BraketItems:r,BraketMethods:o}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/cancel.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},774:function(t,e,a){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CancelConfiguration=e.CancelMethods=void 0;var o=a(251),i=a(108),r=a(871),c=n(a(398)),l=a(975);e.CancelMethods={},e.CancelMethods.Cancel=function(t,e,a){var n=t.GetBrackets(e,""),o=t.ParseArg(e),i=c.default.keyvalOptions(n,l.ENCLOSE_OPTIONS);i.notation=a,t.Push(t.create("node","menclose",[o],i))},e.CancelMethods.CancelTo=function(t,e){var a=t.GetBrackets(e,""),n=t.ParseArg(e),o=t.ParseArg(e),r=c.default.keyvalOptions(a,l.ENCLOSE_OPTIONS);r.notation=[i.TexConstant.Notation.UPDIAGONALSTRIKE,i.TexConstant.Notation.UPDIAGONALARROW,i.TexConstant.Notation.NORTHEASTARROW].join(" "),n=t.create("node","mpadded",[n],{depth:"-.1em",height:"+.1em",voffset:".1em"}),t.Push(t.create("node","msup",[t.create("node","menclose",[o],r),n]))},new r.CommandMap("cancel",{cancel:["Cancel",i.TexConstant.Notation.UPDIAGONALSTRIKE],bcancel:["Cancel",i.TexConstant.Notation.DOWNDIAGONALSTRIKE],xcancel:["Cancel",i.TexConstant.Notation.UPDIAGONALSTRIKE+" "+i.TexConstant.Notation.DOWNDIAGONALSTRIKE],cancelto:"CancelTo"},e.CancelMethods),e.CancelConfiguration=o.Configuration.create("cancel",{handler:{macro:["cancel"]}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TexConstant=MathJax._.input.tex.TexConstants.TexConstant},975:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ENCLOSE_OPTIONS=MathJax._.input.tex.enclose.EncloseConfiguration.ENCLOSE_OPTIONS,e.EncloseMethods=MathJax._.input.tex.enclose.EncloseConfiguration.EncloseMethods,e.EncloseConfiguration=MathJax._.input.tex.enclose.EncloseConfiguration.EncloseConfiguration}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var a=o[t]={exports:{}};return n[t].call(a.exports,a,a.exports,i),a.exports}t=i(955),e=i(667),a=i(774),MathJax.loader&&MathJax.loader.checkVersion("[tex]/cancel",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{cancel:{CancelConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/cases.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},530:function(t,e,a){var n,s,r=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CasesConfiguration=e.CasesMethods=e.CasesTags=e.CasesBeginItem=void 0;var i=a(251),u=a(871),m=o(a(398)),p=o(a(360)),l=o(a(402)),c=a(935),h=a(379),x=a(446),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),Object.defineProperty(e.prototype,"kind",{get:function(){return"cases-begin"},enumerable:!1,configurable:!0}),e.prototype.checkItem=function(e){return e.isKind("end")&&e.getName()===this.getName()&&this.getProperty("end")?(this.setProperty("end",!1),[[],!0]):t.prototype.checkItem.call(this,e)},e}(c.BeginItem);e.CasesBeginItem=f;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subcounter=0,e}return r(e,t),e.prototype.start=function(e,a,n){this.subcounter=0,t.prototype.start.call(this,e,a,n)},e.prototype.autoTag=function(){null==this.currentTag.tag&&("subnumcases"===this.currentTag.env?(0===this.subcounter&&this.counter++,this.subcounter++,this.tag(this.formatNumber(this.counter,this.subcounter),!1)):(0!==this.subcounter&&"numcases-left"===this.currentTag.env||this.counter++,this.tag(this.formatNumber(this.counter),!1)))},e.prototype.formatNumber=function(t,e){return void 0===e&&(e=null),t.toString()+(null===e?"":String.fromCharCode(96+e))},e}(h.AmsTags);e.CasesTags=M,e.CasesMethods={NumCases:function(t,e){if(t.stack.env.closing===e.getName()){delete t.stack.env.closing,t.Push(t.itemFactory.create("end").setProperty("name",e.getName()));var a=t.stack.Top(),n=a.Last,s=m.default.copyNode(n,t),r=a.getProperty("left");return x.EmpheqUtil.left(n,s,r+"\\empheqlbrace\\,",t,"numcases-left"),t.Push(t.itemFactory.create("end").setProperty("name",e.getName())),null}r=t.GetArgument("\\begin{"+e.getName()+"}");e.setProperty("left",r);var o=p.default.EqnArray(t,e,!0,!0,"ll");return o.arraydef.displaystyle=!1,o.arraydef.rowspacing=".2em",o.setProperty("numCases",!0),t.Push(e),o},Entry:function(t,e){if(!t.stack.Top().getProperty("numCases"))return p.default.Entry(t,e);t.Push(t.itemFactory.create("cell").setProperties({isEntry:!0,name:e}));for(var a=t.string,n=0,s=t.i,r=a.length;s=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CenternotConfiguration=t.filterCenterOver=void 0;var o=a(251),i=r(a(193)),u=r(a(748)),l=a(871),p=r(a(360));function c(e){var t,a,r=e.data;try{for(var o=n(r.getList("centerOver")),i=o.next();!i.done;i=o.next()){var l=i.value,p=u.default.getTexClass(l.childNodes[0].childNodes[0]);null!==p&&u.default.setProperties(l.parent.parent.parent.parent.parent.parent,{texClass:p})}}catch(e){t={error:e}}finally{try{i&&!i.done&&(a=o.return)&&a.call(o)}finally{if(t)throw t.error}}}new l.CommandMap("centernot",{centerOver:"CenterOver",centernot:["Macro","\\centerOver{#1}{{\u29f8}}",1]},{CenterOver:function(e,t){var a="{"+e.GetArgument(t)+"}",n=e.ParseArg(t),r=new i.default(a,e.stack.env,e.configuration).mml(),o=e.create("node","TeXAtom",[new i.default(a,e.stack.env,e.configuration).mml(),e.create("node","mpadded",[e.create("node","mpadded",[n],{width:0,lspace:"-.5width"}),e.create("node","mphantom",[r])],{width:0,lspace:"-.5width"})]);e.configuration.addNode("centerOver",r),e.Push(o)},Macro:p.default.Macro}),t.filterCenterOver=c,t.CenternotConfiguration=o.Configuration.create("centernot",{handler:{macro:["centernot"]},postprocessors:[c]})},955:function(e,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.NodeUtil.default},871:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseResult=MathJax._.input.tex.SymbolMap.parseResult,t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},193:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.TexParser.default},360:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.base.BaseMethods.default}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={exports:{}};return n[e].call(a.exports,a,a.exports,o),a.exports}e=o(955),t=o(667),a=o(286),MathJax.loader&&MathJax.loader.checkVersion("[tex]/centernot",t.q,"tex-extension"),(0,e.r8)({_:{input:{tex:{centernot:{CenternotConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/color.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e,o,t,r,a,n,l={667:function(e,o){o.q=void 0,o.q="3.2.2"},224:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.ColorConfiguration=void 0;var r=t(871),a=t(251),n=t(162),l=t(358);new r.CommandMap("color",{color:"Color",textcolor:"TextColor",definecolor:"DefineColor",colorbox:"ColorBox",fcolorbox:"FColorBox"},n.ColorMethods);o.ColorConfiguration=a.Configuration.create("color",{handler:{macro:["color"]},options:{color:{padding:"5px",borderWidth:"2px"}},config:function(e,o){o.parseOptions.packageData.set("color",{model:new l.ColorModel})}})},59:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.COLORS=void 0,o.COLORS=new Map([["Apricot","#FBB982"],["Aquamarine","#00B5BE"],["Bittersweet","#C04F17"],["Black","#221E1F"],["Blue","#2D2F92"],["BlueGreen","#00B3B8"],["BlueViolet","#473992"],["BrickRed","#B6321C"],["Brown","#792500"],["BurntOrange","#F7921D"],["CadetBlue","#74729A"],["CarnationPink","#F282B4"],["Cerulean","#00A2E3"],["CornflowerBlue","#41B0E4"],["Cyan","#00AEEF"],["Dandelion","#FDBC42"],["DarkOrchid","#A4538A"],["Emerald","#00A99D"],["ForestGreen","#009B55"],["Fuchsia","#8C368C"],["Goldenrod","#FFDF42"],["Gray","#949698"],["Green","#00A64F"],["GreenYellow","#DFE674"],["JungleGreen","#00A99A"],["Lavender","#F49EC4"],["LimeGreen","#8DC73E"],["Magenta","#EC008C"],["Mahogany","#A9341F"],["Maroon","#AF3235"],["Melon","#F89E7B"],["MidnightBlue","#006795"],["Mulberry","#A93C93"],["NavyBlue","#006EB8"],["OliveGreen","#3C8031"],["Orange","#F58137"],["OrangeRed","#ED135A"],["Orchid","#AF72B0"],["Peach","#F7965A"],["Periwinkle","#7977B8"],["PineGreen","#008B72"],["Plum","#92268F"],["ProcessBlue","#00B0F0"],["Purple","#99479B"],["RawSienna","#974006"],["Red","#ED1B23"],["RedOrange","#F26035"],["RedViolet","#A1246B"],["Rhodamine","#EF559F"],["RoyalBlue","#0071BC"],["RoyalPurple","#613F99"],["RubineRed","#ED017D"],["Salmon","#F69289"],["SeaGreen","#3FBC9D"],["Sepia","#671800"],["SkyBlue","#46C5DD"],["SpringGreen","#C6DC67"],["Tan","#DA9D76"],["TealBlue","#00AEB3"],["Thistle","#D883B7"],["Turquoise","#00B4CE"],["Violet","#58429B"],["VioletRed","#EF58A0"],["White","#FFFFFF"],["WildStrawberry","#EE2967"],["Yellow","#FFF200"],["YellowGreen","#98CC70"],["YellowOrange","#FAA21A"]])},162:function(e,o,t){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.ColorMethods=void 0;var a=r(t(748)),n=r(t(398));function l(e){var o="+".concat(e),t=e.replace(/^.*?([a-z]*)$/,"$1"),r=2*parseFloat(o);return{width:"+".concat(r).concat(t),height:o,depth:o,lspace:e}}o.ColorMethods={},o.ColorMethods.Color=function(e,o){var t=e.GetBrackets(o,""),r=e.GetArgument(o),a=e.configuration.packageData.get("color").model.getColor(t,r),n=e.itemFactory.create("style").setProperties({styles:{mathcolor:a}});e.stack.env.color=a,e.Push(n)},o.ColorMethods.TextColor=function(e,o){var t=e.GetBrackets(o,""),r=e.GetArgument(o),a=e.configuration.packageData.get("color").model.getColor(t,r),n=e.stack.env.color;e.stack.env.color=a;var l=e.ParseArg(o);n?e.stack.env.color=n:delete e.stack.env.color;var i=e.create("node","mstyle",[l],{mathcolor:a});e.Push(i)},o.ColorMethods.DefineColor=function(e,o){var t=e.GetArgument(o),r=e.GetArgument(o),a=e.GetArgument(o);e.configuration.packageData.get("color").model.defineColor(r,t,a)},o.ColorMethods.ColorBox=function(e,o){var t=e.GetArgument(o),r=n.default.internalMath(e,e.GetArgument(o)),i=e.configuration.packageData.get("color").model,u=e.create("node","mpadded",r,{mathbackground:i.getColor("named",t)});a.default.setProperties(u,l(e.options.color.padding)),e.Push(u)},o.ColorMethods.FColorBox=function(e,o){var t=e.GetArgument(o),r=e.GetArgument(o),i=n.default.internalMath(e,e.GetArgument(o)),u=e.options.color,d=e.configuration.packageData.get("color").model,c=e.create("node","mpadded",i,{mathbackground:d.getColor("named",r),style:"border: ".concat(u.borderWidth," solid ").concat(d.getColor("named",t))});a.default.setProperties(c,l(u.padding)),e.Push(c)}},358:function(e,o,t){var r=this&&this.__values||function(e){var o="function"==typeof Symbol&&Symbol.iterator,t=o&&e[o],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.ColorModel=void 0;var n=a(t(402)),l=t(59),i=new Map,u=function(){function e(){this.userColors=new Map}return e.prototype.normalizeColor=function(e,o){if(!e||"named"===e)return o;if(i.has(e))return i.get(e)(o);throw new n.default("UndefinedColorModel","Color model '%1' not defined",e)},e.prototype.getColor=function(e,o){return e&&"named"!==e?this.normalizeColor(e,o):this.getColorByName(o)},e.prototype.getColorByName=function(e){return this.userColors.has(e)?this.userColors.get(e):l.COLORS.has(e)?l.COLORS.get(e):e},e.prototype.defineColor=function(e,o,t){var r=this.normalizeColor(e,t);this.userColors.set(o,r)},e}();o.ColorModel=u,i.set("rgb",(function(e){var o,t,a=e.trim().split(/\s*,\s*/),l="#";if(3!==a.length)throw new n.default("ModelArg1","Color values for the %1 model require 3 numbers","rgb");try{for(var i=r(a),u=i.next();!u.done;u=i.next()){var d=u.value;if(!d.match(/^(\d+(\.\d*)?|\.\d+)$/))throw new n.default("InvalidDecimalNumber","Invalid decimal number");var c=parseFloat(d);if(c<0||c>1)throw new n.default("ModelArg2","Color values for the %1 model must be between %2 and %3","rgb","0","1");var s=Math.floor(255*c).toString(16);s.length<2&&(s="0"+s),l+=s}}catch(e){o={error:e}}finally{try{u&&!u.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return l})),i.set("RGB",(function(e){var o,t,a=e.trim().split(/\s*,\s*/),l="#";if(3!==a.length)throw new n.default("ModelArg1","Color values for the %1 model require 3 numbers","RGB");try{for(var i=r(a),u=i.next();!u.done;u=i.next()){var d=u.value;if(!d.match(/^\d+$/))throw new n.default("InvalidNumber","Invalid number");var c=parseInt(d);if(c>255)throw new n.default("ModelArg2","Color values for the %1 model must be between %2 and %3","RGB","0","255");var s=c.toString(16);s.length<2&&(s="0"+s),l+=s}}catch(e){o={error:e}}finally{try{u&&!u.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return l})),i.set("gray",(function(e){if(!e.match(/^\s*(\d+(\.\d*)?|\.\d+)\s*$/))throw new n.default("InvalidDecimalNumber","Invalid decimal number");var o=parseFloat(e);if(o<0||o>1)throw new n.default("ModelArg2","Color values for the %1 model must be between %2 and %3","gray","0","1");var t=Math.floor(255*o).toString(16);return t.length<2&&(t="0"+t),"#".concat(t).concat(t).concat(t)}))},955:function(e,o){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,o.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Configuration=MathJax._.input.tex.Configuration.Configuration,o.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,o.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=MathJax._.input.tex.NodeUtil.default},398:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=MathJax._.input.tex.ParseUtil.default},871:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.parseResult=MathJax._.input.tex.SymbolMap.parseResult,o.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,o.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,o.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,o.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,o.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,o.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,o.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,o.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=MathJax._.input.tex.TexError.default}},i={};function u(e){var o=i[e];if(void 0!==o)return o.exports;var t=i[e]={exports:{}};return l[e].call(t.exports,t,t.exports,u),t.exports}e=u(955),o=u(667),t=u(224),r=u(59),a=u(162),n=u(358),MathJax.loader&&MathJax.loader.checkVersion("[tex]/color",o.q,"tex-extension"),(0,e.r8)({_:{input:{tex:{color:{ColorConfiguration:t,ColorConstants:r,ColorMethods:a,ColorUtil:n}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/colortbl.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,o={667:function(t,e){e.q=void 0,e.q="3.2.2"},558:function(t,e,a){var o,n=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ColortblConfiguration=e.ColorArrayItem=void 0;var i=a(935),s=a(251),l=a(871),p=r(a(402)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.color={cell:"",row:"",col:[]},e.hasColor=!1,e}return n(e,t),e.prototype.EndEntry=function(){t.prototype.EndEntry.call(this);var e=this.row[this.row.length-1],a=this.color.cell||this.color.row||this.color.col[this.row.length-1];a&&(e.attributes.set("mathbackground",a),this.color.cell="",this.hasColor=!0)},e.prototype.EndRow=function(){t.prototype.EndRow.call(this),this.color.row=""},e.prototype.createMml=function(){var e=t.prototype.createMml.call(this),a=e.isKind("mrow")?e.childNodes[1]:e;return a.isKind("menclose")&&(a=a.childNodes[0].childNodes[0]),this.hasColor&&"none"===a.attributes.get("frame")&&a.attributes.set("frame",""),e},e}(i.ArrayItem);e.ColorArrayItem=u,new l.CommandMap("colortbl",{cellcolor:["TableColor","cell"],rowcolor:["TableColor","row"],columncolor:["TableColor","col"]},{TableColor:function(t,e,a){var o=t.configuration.packageData.get("color").model,n=t.GetBrackets(e,""),r=o.getColor(n,t.GetArgument(e)),i=t.stack.Top();if(!(i instanceof u))throw new p.default("UnsupportedTableColor","Unsupported use of %1",t.currentCS);if("col"===a){if(i.table.length)throw new p.default("ColumnColorNotTop","%1 must be in the top row",e);i.color.col[i.row.length]=r,t.GetBrackets(e,"")&&t.GetBrackets(e,"")}else if(i.color[a]=r,"row"===a&&(i.Size()||i.row.length))throw new p.default("RowColorNotFirst","%1 must be at the beginning of a row",e)}});e.ColortblConfiguration=s.Configuration.create("colortbl",{handler:{macro:["colortbl"]},items:{array:u},priority:10,config:[function(t,e){e.parseOptions.packageData.has("color")||s.ConfigurationHandler.get("color").config(t,e)},10]})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default},935:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.StartItem=MathJax._.input.tex.base.BaseItems.StartItem,e.StopItem=MathJax._.input.tex.base.BaseItems.StopItem,e.OpenItem=MathJax._.input.tex.base.BaseItems.OpenItem,e.CloseItem=MathJax._.input.tex.base.BaseItems.CloseItem,e.PrimeItem=MathJax._.input.tex.base.BaseItems.PrimeItem,e.SubsupItem=MathJax._.input.tex.base.BaseItems.SubsupItem,e.OverItem=MathJax._.input.tex.base.BaseItems.OverItem,e.LeftItem=MathJax._.input.tex.base.BaseItems.LeftItem,e.Middle=MathJax._.input.tex.base.BaseItems.Middle,e.RightItem=MathJax._.input.tex.base.BaseItems.RightItem,e.BeginItem=MathJax._.input.tex.base.BaseItems.BeginItem,e.EndItem=MathJax._.input.tex.base.BaseItems.EndItem,e.StyleItem=MathJax._.input.tex.base.BaseItems.StyleItem,e.PositionItem=MathJax._.input.tex.base.BaseItems.PositionItem,e.CellItem=MathJax._.input.tex.base.BaseItems.CellItem,e.MmlItem=MathJax._.input.tex.base.BaseItems.MmlItem,e.FnItem=MathJax._.input.tex.base.BaseItems.FnItem,e.NotItem=MathJax._.input.tex.base.BaseItems.NotItem,e.NonscriptItem=MathJax._.input.tex.base.BaseItems.NonscriptItem,e.DotsItem=MathJax._.input.tex.base.BaseItems.DotsItem,e.ArrayItem=MathJax._.input.tex.base.BaseItems.ArrayItem,e.EqnArrayItem=MathJax._.input.tex.base.BaseItems.EqnArrayItem,e.EquationItem=MathJax._.input.tex.base.BaseItems.EquationItem}},n={};function r(t){var e=n[t];if(void 0!==e)return e.exports;var a=n[t]={exports:{}};return o[t].call(a.exports,a,a.exports,r),a.exports}t=r(955),e=r(667),a=r(558),MathJax.loader&&MathJax.loader.checkVersion("[tex]/colortbl",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{colortbl:{ColortblConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/colorv2.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var o,a,t,e={667:function(o,a){a.q=void 0,a.q="3.2.2"},888:function(o,a,t){Object.defineProperty(a,"__esModule",{value:!0}),a.ColorConfiguration=a.ColorV2Methods=void 0;var e=t(871),n=t(251);a.ColorV2Methods={Color:function(o,a){var t=o.GetArgument(a),e=o.stack.env.color;o.stack.env.color=t;var n=o.ParseArg(a);e?o.stack.env.color=e:delete o.stack.env.color;var r=o.create("node","mstyle",[n],{mathcolor:t});o.Push(r)}},new e.CommandMap("colorv2",{color:"Color"},a.ColorV2Methods),a.ColorConfiguration=n.Configuration.create("colorv2",{handler:{macro:["colorv2"]}})},955:function(o,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.parseResult=MathJax._.input.tex.SymbolMap.parseResult,a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap}},n={};function r(o){var a=n[o];if(void 0!==a)return a.exports;var t=n[o]={exports:{}};return e[o](t,t.exports,r),t.exports}o=r(955),a=r(667),t=r(888),MathJax.loader&&MathJax.loader.checkVersion("[tex]/colorv2",a.q,"tex-extension"),(0,o.r8)({_:{input:{tex:{colorv2:{ColorV2Configuration:t}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/configmacros.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,a,e,n={667:function(t,a){a.q=void 0,a.q="3.2.2"},359:function(t,a,e){var n,o=this&&this.__values||function(t){var a="function"==typeof Symbol&&Symbol.iterator,e=a&&t[a],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a,"__esModule",{value:!0}),a.ConfigMacrosConfiguration=void 0;var r=e(251),p=e(74),l=e(871),s=i(e(945)),u=e(924),c=i(e(432)),M=e(975),x="configmacros-map",f="configmacros-env-map";a.ConfigMacrosConfiguration=r.Configuration.create("configmacros",{init:function(t){new l.CommandMap(x,{},{}),new l.EnvironmentMap(f,s.default.environment,{},{}),t.append(r.Configuration.local({handler:{macro:[x],environment:[f]},priority:3}))},config:function(t,a){!function(t){var a,e,n=t.parseOptions.handlers.retrieve(x),i=t.parseOptions.options.macros;try{for(var r=o(Object.keys(i)),p=r.next();!p.done;p=r.next()){var l=p.value,s="string"==typeof i[l]?[i[l]]:i[l],M=Array.isArray(s[2])?new u.Macro(l,c.default.MacroWithTemplate,s.slice(0,2).concat(s[2])):new u.Macro(l,c.default.Macro,s);n.add(l,M)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(e=r.return)&&e.call(r)}finally{if(a)throw a.error}}}(a),function(t){var a,e,n=t.parseOptions.handlers.retrieve(f),i=t.parseOptions.options.environments;try{for(var r=o(Object.keys(i)),p=r.next();!p.done;p=r.next()){var l=p.value;n.add(l,new u.Macro(l,c.default.BeginEnv,[!0].concat(i[l])))}}catch(t){a={error:t}}finally{try{p&&!p.done&&(e=r.return)&&e.call(r)}finally{if(a)throw a.error}}}(a)},items:(n={},n[M.BeginEnvItem.prototype.kind]=M.BeginEnvItem,n),options:{macros:(0,p.expandable)({}),environments:(0,p.expandable)({})}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},74:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.isObject=MathJax._.util.Options.isObject,a.APPEND=MathJax._.util.Options.APPEND,a.REMOVE=MathJax._.util.Options.REMOVE,a.OPTIONS=MathJax._.util.Options.OPTIONS,a.Expandable=MathJax._.util.Options.Expandable,a.expandable=MathJax._.util.Options.expandable,a.makeArray=MathJax._.util.Options.makeArray,a.keys=MathJax._.util.Options.keys,a.copy=MathJax._.util.Options.copy,a.insert=MathJax._.util.Options.insert,a.defaultOptions=MathJax._.util.Options.defaultOptions,a.userOptions=MathJax._.util.Options.userOptions,a.selectOptions=MathJax._.util.Options.selectOptions,a.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,a.separateOptions=MathJax._.util.Options.separateOptions,a.lookup=MathJax._.util.Options.lookup},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},945:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.ParseMethods.default},924:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Symbol=MathJax._.input.tex.Symbol.Symbol,a.Macro=MathJax._.input.tex.Symbol.Macro},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.parseResult=MathJax._.input.tex.SymbolMap.parseResult,a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},975:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.BeginEnvItem=MathJax._.input.tex.newcommand.NewcommandItems.BeginEnvItem},432:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.newcommand.NewcommandMethods.default}},o={};function i(t){var a=o[t];if(void 0!==a)return a.exports;var e=o[t]={exports:{}};return n[t].call(e.exports,e,e.exports,i),e.exports}t=i(955),a=i(667),e=i(359),MathJax.loader&&MathJax.loader.checkVersion("[tex]/configmacros",a.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{configmacros:{ConfigMacrosConfiguration:e}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/empheq.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e,t,a,n,r={667:function(e,t){t.q=void 0,t.q="3.2.2"},79:function(e,t,a){var n,r,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,r,i=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmpheqConfiguration=t.EmpheqMethods=t.EmpheqBeginItem=void 0;var p=a(251),m=a(871),h=l(a(398)),s=l(a(402)),u=a(935),c=a(301),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),Object.defineProperty(t.prototype,"kind",{get:function(){return"empheq-begin"},enumerable:!1,configurable:!0}),t.prototype.checkItem=function(t){return t.isKind("end")&&t.getName()===this.getName()&&this.setProperty("end",!1),e.prototype.checkItem.call(this,t)},t}(u.BeginItem);t.EmpheqBeginItem=d,t.EmpheqMethods={Empheq:function(e,t){if(e.stack.env.closing===t.getName()){delete e.stack.env.closing,e.Push(e.itemFactory.create("end").setProperty("name",e.stack.global.empheq)),e.stack.global.empheq="";var a=e.stack.Top();c.EmpheqUtil.adjustTable(a,e),e.Push(e.itemFactory.create("end").setProperty("name","empheq"))}else{h.default.checkEqnEnv(e),delete e.stack.global.eqnenv;var n=e.GetBrackets("\\begin{"+t.getName()+"}")||"",r=o((e.GetArgument("\\begin{"+t.getName()+"}")||"").split(/=/),2),i=r[0],l=r[1];if(!c.EmpheqUtil.checkEnv(i))throw new s.default("UnknownEnv",'Unknown environment "%1"',i);n&&t.setProperties(c.EmpheqUtil.splitOptions(n,{left:1,right:1})),e.stack.global.empheq=i,e.string="\\begin{"+i+"}"+(l?"{"+l+"}":"")+e.string.slice(e.i),e.i=0,e.Push(t)}},EmpheqMO:function(e,t,a){e.Push(e.create("token","mo",{},a))},EmpheqDelim:function(e,t){var a=e.GetDelimiter(t);e.Push(e.create("token","mo",{stretchy:!0,symmetric:!0},a))}},new m.EnvironmentMap("empheq-env",c.EmpheqUtil.environment,{empheq:["Empheq","empheq"]},t.EmpheqMethods),new m.CommandMap("empheq-macros",{empheqlbrace:["EmpheqMO","{"],empheqrbrace:["EmpheqMO","}"],empheqlbrack:["EmpheqMO","["],empheqrbrack:["EmpheqMO","]"],empheqlangle:["EmpheqMO","\u27e8"],empheqrangle:["EmpheqMO","\u27e9"],empheqlparen:["EmpheqMO","("],empheqrparen:["EmpheqMO",")"],empheqlvert:["EmpheqMO","|"],empheqrvert:["EmpheqMO","|"],empheqlVert:["EmpheqMO","\u2016"],empheqrVert:["EmpheqMO","\u2016"],empheqlfloor:["EmpheqMO","\u230a"],empheqrfloor:["EmpheqMO","\u230b"],empheqlceil:["EmpheqMO","\u2308"],empheqrceil:["EmpheqMO","\u2309"],empheqbiglbrace:["EmpheqMO","{"],empheqbigrbrace:["EmpheqMO","}"],empheqbiglbrack:["EmpheqMO","["],empheqbigrbrack:["EmpheqMO","]"],empheqbiglangle:["EmpheqMO","\u27e8"],empheqbigrangle:["EmpheqMO","\u27e9"],empheqbiglparen:["EmpheqMO","("],empheqbigrparen:["EmpheqMO",")"],empheqbiglvert:["EmpheqMO","|"],empheqbigrvert:["EmpheqMO","|"],empheqbiglVert:["EmpheqMO","\u2016"],empheqbigrVert:["EmpheqMO","\u2016"],empheqbiglfloor:["EmpheqMO","\u230a"],empheqbigrfloor:["EmpheqMO","\u230b"],empheqbiglceil:["EmpheqMO","\u2308"],empheqbigrceil:["EmpheqMO","\u2309"],empheql:"EmpheqDelim",empheqr:"EmpheqDelim",empheqbigl:"EmpheqDelim",empheqbigr:"EmpheqDelim"},t.EmpheqMethods),t.EmpheqConfiguration=p.Configuration.create("empheq",{handler:{macro:["empheq-macros"],environment:["empheq-env"]},items:(r={},r[d.prototype.kind]=d,r)})},301:function(e,t,a){var n=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,r,i=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o},r=this&&this.__spreadArray||function(e,t,a){if(a||2===arguments.length)for(var n,r=0,i=t.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmpheqUtil=void 0;var l=o(a(398)),p=o(a(193));t.EmpheqUtil={environment:function(e,t,a,i){var o=i[0],l=e.itemFactory.create(o+"-begin").setProperties({name:t,end:o});e.Push(a.apply(void 0,r([e,l],n(i.slice(1)),!1)))},splitOptions:function(e,t){return void 0===t&&(t=null),l.default.keyvalOptions(e,t,!0)},columnCount:function(e){var t,a,n=0;try{for(var r=i(e.childNodes),o=r.next();!o.done;o=r.next()){var l=o.value,p=l.childNodes.length-(l.isKind("mlabeledtr")?1:0);p>n&&(n=p)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}return n},cellBlock:function(e,t,a,n){var r,o,l=a.create("node","mpadded",[],{height:0,depth:0,voffset:"-1height"}),m=new p.default(e,a.stack.env,a.configuration),h=m.mml();n&&m.configuration.tags.label&&(m.configuration.tags.currentTag.env=n,m.configuration.tags.getTag(!0));try{for(var s=i(h.isInferred?h.childNodes:[h]),u=s.next();!u.done;u=s.next()){var c=u.value;l.appendChild(c)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return l.appendChild(a.create("node","mphantom",[a.create("node","mpadded",[t],{width:0})])),l},topRowTable:function(e,t){var a=l.default.copyNode(e,t);return a.setChildren(a.childNodes.slice(0,1)),a.attributes.set("align","baseline 1"),e.factory.create("mphantom",{},[t.create("node","mpadded",[a],{width:0})])},rowspanCell:function(e,t,a,n,r){e.appendChild(n.create("node","mpadded",[this.cellBlock(t,l.default.copyNode(a,n),n,r),this.topRowTable(a,n)],{height:0,depth:0,voffset:"height"}))},left:function(e,t,a,n,r){var o,l,p;void 0===r&&(r=""),e.attributes.set("columnalign","right "+(e.attributes.get("columnalign")||"")),e.attributes.set("columnspacing","0em "+(e.attributes.get("columnspacing")||""));try{for(var m=i(e.childNodes.slice(0).reverse()),h=m.next();!h.done;h=m.next()){var s=h.value;p=n.create("node","mtd"),s.childNodes.unshift(p),p.parent=s,s.isKind("mlabeledtr")&&(s.childNodes[0]=s.childNodes[1],s.childNodes[1]=p)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(l=m.return)&&l.call(m)}finally{if(o)throw o.error}}this.rowspanCell(p,a,t,n,r)},right:function(e,a,n,r,i){void 0===i&&(i=""),0===e.childNodes.length&&e.appendChild(r.create("node","mtr"));for(var o=t.EmpheqUtil.columnCount(e),l=e.childNodes[0];l.childNodes.length=n.length&&(n=void 0),{value:n&&n[t++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(o,"__esModule",{value:!0}),o.NoUndefinedConfiguration=void 0;var r=e(251);o.NoUndefinedConfiguration=r.Configuration.create("noundefined",{fallback:{macro:function(n,o){var e,r,i=n.create("text","\\"+o),a=n.options.noundefined||{},u={};try{for(var f=t(["color","background","size"]),l=f.next();!l.done;l=f.next()){var c=l.value;a[c]&&(u["math"+c]=a[c])}}catch(n){e={error:n}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}n.Push(n.create("node","mtext",[],u,i))}},options:{noundefined:{color:"red",background:"",size:""}},priority:3})},955:function(n,o){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,o.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(n,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Configuration=MathJax._.input.tex.Configuration.Configuration,o.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,o.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration}},r={};function i(n){var o=r[n];if(void 0!==o)return o.exports;var e=r[n]={exports:{}};return t[n].call(e.exports,e,e.exports,i),e.exports}n=i(955),o=i(667),e=i(999),MathJax.loader&&MathJax.loader.checkVersion("[tex]/noundefined",o.q,"tex-extension"),(0,n.r8)({_:{input:{tex:{noundefined:{NoUndefinedConfiguration:e}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/require.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e,t,a,o={667:function(e,t){t.q=void 0,t.q="3.2.2"},778:function(e,t,a){var o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],o=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var o,r,n=a.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return i},n=this&&this.__spreadArray||function(e,t,a){if(a||2===arguments.length)for(var o,r=0,n=t.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SetOptionsConfiguration=e.SetOptionsUtil=void 0;var i=a(251),r=a(871),l=n(a(402)),p=n(a(398)),s=a(924),u=n(a(360)),f=a(74);e.SetOptionsUtil={filterPackage:function(t,e){if("tex"!==e&&!i.ConfigurationHandler.get(e))throw new l.default("NotAPackage","Not a defined package: %1",e);var a=t.options.setoptions,o=a.allowOptions[e];if(void 0===o&&!a.allowPackageDefault||!1===o)throw new l.default("PackageNotSettable",'Options can\'t be set for package "%1"',e);return!0},filterOption:function(t,e,a){var o,n=t.options.setoptions,i=n.allowOptions[e]||{},r=i.hasOwnProperty(a)&&!(0,f.isObject)(i[a])?i[a]:null;if(!1===r||null===r&&!n.allowOptionsDefault)throw new l.default("OptionNotSettable",'Option "%1" is not allowed to be set',a);if(!(null===(o="tex"===e?t.options:t.options[e])||void 0===o?void 0:o.hasOwnProperty(a)))throw"tex"===e?new l.default("InvalidTexOption",'Invalid TeX option "%1"',a):new l.default("InvalidOptionKey",'Invalid option "%1" for package "%2"',a,e);return!0},filterValue:function(t,e,a,o){return o}};var c=new r.CommandMap("setoptions",{setOptions:"SetOptions"},{SetOptions:function(t,e){var a,n,i=t.GetBrackets(e)||"tex",r=p.default.keyvalOptions(t.GetArgument(e)),l=t.options.setoptions;if(l.filterPackage(t,i))try{for(var s=o(Object.keys(r)),u=s.next();!u.done;u=s.next()){var f=u.value;l.filterOption(t,i,f)&&(("tex"===i?t.options:t.options[i])[f]=l.filterValue(t,i,f,r[f]))}}catch(t){a={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}}});e.SetOptionsConfiguration=i.Configuration.create("setoptions",{handler:{macro:["setoptions"]},config:function(t,e){var a=e.parseOptions.handlers.get("macro").lookup("require");a&&(c.add("Require",new s.Macro("Require",a._func)),c.add("require",new s.Macro("require",u.default.Macro,["\\Require{#2}\\setOptions[#2]{#1}",2,""])))},priority:3,options:{setoptions:{filterPackage:e.SetOptionsUtil.filterPackage,filterOption:e.SetOptionsUtil.filterOption,filterValue:e.SetOptionsUtil.filterValue,allowPackageDefault:!0,allowOptionsDefault:!0,allowOptions:(0,f.expandable)({tex:{FindTeX:!1,formatError:!1,package:!1,baseURL:!1,tags:!1,maxBuffer:!1,maxMaxros:!1,macros:!1,environments:!1},setoptions:!1,autoload:!1,require:!1,configmacros:!1,tagformat:!1})}}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},74:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.util.Options.isObject,e.APPEND=MathJax._.util.Options.APPEND,e.REMOVE=MathJax._.util.Options.REMOVE,e.OPTIONS=MathJax._.util.Options.OPTIONS,e.Expandable=MathJax._.util.Options.Expandable,e.expandable=MathJax._.util.Options.expandable,e.makeArray=MathJax._.util.Options.makeArray,e.keys=MathJax._.util.Options.keys,e.copy=MathJax._.util.Options.copy,e.insert=MathJax._.util.Options.insert,e.defaultOptions=MathJax._.util.Options.defaultOptions,e.userOptions=MathJax._.util.Options.userOptions,e.selectOptions=MathJax._.util.Options.selectOptions,e.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,e.separateOptions=MathJax._.util.Options.separateOptions,e.lookup=MathJax._.util.Options.lookup},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},924:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Symbol=MathJax._.input.tex.Symbol.Symbol,e.Macro=MathJax._.input.tex.Symbol.Macro},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default},360:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.base.BaseMethods.default}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var a=n[t]={exports:{}};return o[t].call(a.exports,a,a.exports,i),a.exports}t=i(955),e=i(667),a=i(596),MathJax.loader&&MathJax.loader.checkVersion("[tex]/setoptions",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{setoptions:{SetOptionsConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/tagformat.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,o,n,a={667:function(t,o){o.q=void 0,o.q="3.2.2"},941:function(t,o,n){var a,r=this&&this.__extends||(a=function(t,o){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])},a(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}a(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)});Object.defineProperty(o,"__esModule",{value:!0}),o.TagFormatConfiguration=o.tagformatConfig=void 0;var e=n(251),i=n(680),s=0;function u(t,o){var n=o.parseOptions.options.tags;"base"!==n&&t.tags.hasOwnProperty(n)&&i.TagsFactory.add(n,t.tags[n]);var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.formatNumber=function(t){return o.parseOptions.options.tagformat.number(t)},n.prototype.formatTag=function(t){return o.parseOptions.options.tagformat.tag(t)},n.prototype.formatId=function(t){return o.parseOptions.options.tagformat.id(t)},n.prototype.formatUrl=function(t,n){return o.parseOptions.options.tagformat.url(t,n)},n}(i.TagsFactory.create(o.parseOptions.options.tags).constructor),e="configTags-"+ ++s;i.TagsFactory.add(e,a),o.parseOptions.options.tags=e}o.tagformatConfig=u,o.TagFormatConfiguration=e.Configuration.create("tagformat",{config:[u,10],options:{tagformat:{number:function(t){return t.toString()},tag:function(t){return"("+t+")"},id:function(t){return"mjx-eqn:"+t.replace(/\s/g,"_")},url:function(t,o){return o+"#"+encodeURIComponent(t)}}}})},955:function(t,o){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,o.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Configuration=MathJax._.input.tex.Configuration.Configuration,o.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,o.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},680:function(t,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Label=MathJax._.input.tex.Tags.Label,o.TagInfo=MathJax._.input.tex.Tags.TagInfo,o.AbstractTags=MathJax._.input.tex.Tags.AbstractTags,o.NoTags=MathJax._.input.tex.Tags.NoTags,o.AllTags=MathJax._.input.tex.Tags.AllTags,o.TagsFactory=MathJax._.input.tex.Tags.TagsFactory}},r={};function e(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return a[t].call(n.exports,n,n.exports,e),n.exports}t=e(955),o=e(667),n=e(941),MathJax.loader&&MathJax.loader.checkVersion("[tex]/tagformat",o.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{tagformat:{TagFormatConfiguration:n}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/textcomp.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,n,r={667:function(t,e){e.q=void 0,e.q="3.2.2"},845:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TextcompConfiguration=void 0;var r=n(251);n(832),e.TextcompConfiguration=r.Configuration.create("textcomp",{handler:{macro:["textcomp-macros"]}})},832:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(871),s=n(108),o=n(245),x=r(n(398)),i=n(988);new a.CommandMap("textcomp-macros",{textasciicircum:["Insert","^"],textasciitilde:["Insert","~"],textasteriskcentered:["Insert","*"],textbackslash:["Insert","\\"],textbar:["Insert","|"],textbraceleft:["Insert","{"],textbraceright:["Insert","}"],textbullet:["Insert","\u2022"],textdagger:["Insert","\u2020"],textdaggerdbl:["Insert","\u2021"],textellipsis:["Insert","\u2026"],textemdash:["Insert","\u2014"],textendash:["Insert","\u2013"],textexclamdown:["Insert","\xa1"],textgreater:["Insert",">"],textless:["Insert","<"],textordfeminine:["Insert","\xaa"],textordmasculine:["Insert","\xba"],textparagraph:["Insert","\xb6"],textperiodcentered:["Insert","\xb7"],textquestiondown:["Insert","\xbf"],textquotedblleft:["Insert","\u201c"],textquotedblright:["Insert","\u201d"],textquoteleft:["Insert","\u2018"],textquoteright:["Insert","\u2019"],textsection:["Insert","\xa7"],textunderscore:["Insert","_"],textvisiblespace:["Insert","\u2423"],textacutedbl:["Insert","\u02dd"],textasciiacute:["Insert","\xb4"],textasciibreve:["Insert","\u02d8"],textasciicaron:["Insert","\u02c7"],textasciidieresis:["Insert","\xa8"],textasciimacron:["Insert","\xaf"],textgravedbl:["Insert","\u02f5"],texttildelow:["Insert","\u02f7"],textbaht:["Insert","\u0e3f"],textcent:["Insert","\xa2"],textcolonmonetary:["Insert","\u20a1"],textcurrency:["Insert","\xa4"],textdollar:["Insert","$"],textdong:["Insert","\u20ab"],texteuro:["Insert","\u20ac"],textflorin:["Insert","\u0192"],textguarani:["Insert","\u20b2"],textlira:["Insert","\u20a4"],textnaira:["Insert","\u20a6"],textpeso:["Insert","\u20b1"],textsterling:["Insert","\xa3"],textwon:["Insert","\u20a9"],textyen:["Insert","\xa5"],textcircledP:["Insert","\u2117"],textcompwordmark:["Insert","\u200c"],textcopyleft:["Insert","\ud83c\udd2f"],textcopyright:["Insert","\xa9"],textregistered:["Insert","\xae"],textservicemark:["Insert","\u2120"],texttrademark:["Insert","\u2122"],textbardbl:["Insert","\u2016"],textbigcircle:["Insert","\u25ef"],textblank:["Insert","\u2422"],textbrokenbar:["Insert","\xa6"],textdiscount:["Insert","\u2052"],textestimated:["Insert","\u212e"],textinterrobang:["Insert","\u203d"],textinterrobangdown:["Insert","\u2e18"],textmusicalnote:["Insert","\u266a"],textnumero:["Insert","\u2116"],textopenbullet:["Insert","\u25e6"],textpertenthousand:["Insert","\u2031"],textperthousand:["Insert","\u2030"],textrecipe:["Insert","\u211e"],textreferencemark:["Insert","\u203b"],textlangle:["Insert","\u2329"],textrangle:["Insert","\u232a"],textlbrackdbl:["Insert","\u27e6"],textrbrackdbl:["Insert","\u27e7"],textlquill:["Insert","\u2045"],textrquill:["Insert","\u2046"],textcelsius:["Insert","\u2103"],textdegree:["Insert","\xb0"],textdiv:["Insert","\xf7"],textdownarrow:["Insert","\u2193"],textfractionsolidus:["Insert","\u2044"],textleftarrow:["Insert","\u2190"],textlnot:["Insert","\xac"],textmho:["Insert","\u2127"],textminus:["Insert","\u2212"],textmu:["Insert","\xb5"],textohm:["Insert","\u2126"],textonehalf:["Insert","\xbd"],textonequarter:["Insert","\xbc"],textonesuperior:["Insert","\xb9"],textpm:["Insert","\xb1"],textrightarrow:["Insert","\u2192"],textsurd:["Insert","\u221a"],textthreequarters:["Insert","\xbe"],textthreesuperior:["Insert","\xb3"],texttimes:["Insert","\xd7"],texttwosuperior:["Insert","\xb2"],textuparrow:["Insert","\u2191"],textborn:["Insert","*"],textdied:["Insert","\u2020"],textdivorced:["Insert","\u26ae"],textmarried:["Insert","\u26ad"],textcentoldstyle:["Insert","\xa2",s.TexConstant.Variant.OLDSTYLE],textdollaroldstyle:["Insert","$",s.TexConstant.Variant.OLDSTYLE],textzerooldstyle:["Insert","0",s.TexConstant.Variant.OLDSTYLE],textoneoldstyle:["Insert","1",s.TexConstant.Variant.OLDSTYLE],texttwooldstyle:["Insert","2",s.TexConstant.Variant.OLDSTYLE],textthreeoldstyle:["Insert","3",s.TexConstant.Variant.OLDSTYLE],textfouroldstyle:["Insert","4",s.TexConstant.Variant.OLDSTYLE],textfiveoldstyle:["Insert","5",s.TexConstant.Variant.OLDSTYLE],textsixoldstyle:["Insert","6",s.TexConstant.Variant.OLDSTYLE],textsevenoldstyle:["Insert","7",s.TexConstant.Variant.OLDSTYLE],texteightoldstyle:["Insert","8",s.TexConstant.Variant.OLDSTYLE],textnineoldstyle:["Insert","9",s.TexConstant.Variant.OLDSTYLE]},{Insert:function(t,e,n,r){if(t instanceof i.TextParser){if(!r)return void o.TextMacrosMethods.Insert(t,e,n);t.saveText()}t.Push(x.default.internalText(t,n,r?{mathvariant:r}:{}))}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TexConstant=MathJax._.input.tex.TexConstants.TexConstant},245:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextMacrosMethods=MathJax._.input.tex.textmacros.TextMacrosMethods.TextMacrosMethods},988:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextParser=MathJax._.input.tex.textmacros.TextParser.TextParser}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return r[t].call(n.exports,n,n.exports,s),n.exports}t=s(955),e=s(667),n=s(845),MathJax.loader&&MathJax.loader.checkVersion("[tex]/textcomp",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{textcomp:{TextcompConfiguration:n}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/unicode.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},376:function(t,e,a){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeConfiguration=e.UnicodeMethods=void 0;var o=a(251),i=n(a(402)),r=a(871),u=n(a(398)),l=n(a(748)),c=a(992);e.UnicodeMethods={};var p={};e.UnicodeMethods.Unicode=function(t,e){var a=t.GetBrackets(e),n=null,o=null;a&&(a.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(n=a.replace(/ /g,"").split(/,/),o=t.GetBrackets(e)):o=a);var r=u.default.trimSpaces(t.GetArgument(e)).replace(/^0x/,"x");if(!r.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))throw new i.default("BadUnicode","Argument to \\unicode must be a number");var d=parseInt(r.match(/^x/)?"0"+r:r);p[d]?o||(o=p[d][2]):p[d]=[800,200,o,d],n&&(p[d][0]=Math.floor(1e3*parseFloat(n[0])),p[d][1]=Math.floor(1e3*parseFloat(n[1])));var M=t.stack.env.font,s={};o?(p[d][2]=s.fontfamily=o.replace(/'/g,"'"),M&&(M.match(/bold/)&&(s.fontweight="bold"),M.match(/italic|-mathit/)&&(s.fontstyle="italic"))):M&&(s.mathvariant=M);var x=t.create("token","mtext",s,(0,c.numeric)(r));l.default.setProperty(x,"unicode",!0),t.Push(x)},new r.CommandMap("unicode",{unicode:"Unicode"},e.UnicodeMethods),e.UnicodeConfiguration=o.Configuration.create("unicode",{handler:{macro:["unicode"]}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},992:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.options=MathJax._.util.Entities.options,e.entities=MathJax._.util.Entities.entities,e.add=MathJax._.util.Entities.add,e.remove=MathJax._.util.Entities.remove,e.translate=MathJax._.util.Entities.translate,e.numeric=MathJax._.util.Entities.numeric},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.NodeUtil.default},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseResult=MathJax._.input.tex.SymbolMap.parseResult,e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var a=o[t]={exports:{}};return n[t].call(a.exports,a,a.exports,i),a.exports}t=i(955),e=i(667),a=i(376),MathJax.loader&&MathJax.loader.checkVersion("[tex]/unicode",e.q,"tex-extension"),(0,t.r8)({_:{input:{tex:{unicode:{UnicodeConfiguration:a}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/upgreek.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var a,t,e,p={667:function(a,t){t.q=void 0,t.q="3.2.2"},927:function(a,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.UpgreekConfiguration=void 0;var p=e(251),n=e(871),o=e(108);new n.CharacterMap("upgreek",(function(a,t){var e=t.attributes||{};e.mathvariant=o.TexConstant.Variant.NORMAL;var p=a.create("token","mi",e,t.char);a.Push(p)}),{upalpha:"\u03b1",upbeta:"\u03b2",upgamma:"\u03b3",updelta:"\u03b4",upepsilon:"\u03f5",upzeta:"\u03b6",upeta:"\u03b7",uptheta:"\u03b8",upiota:"\u03b9",upkappa:"\u03ba",uplambda:"\u03bb",upmu:"\u03bc",upnu:"\u03bd",upxi:"\u03be",upomicron:"\u03bf",uppi:"\u03c0",uprho:"\u03c1",upsigma:"\u03c3",uptau:"\u03c4",upupsilon:"\u03c5",upphi:"\u03d5",upchi:"\u03c7",uppsi:"\u03c8",upomega:"\u03c9",upvarepsilon:"\u03b5",upvartheta:"\u03d1",upvarpi:"\u03d6",upvarrho:"\u03f1",upvarsigma:"\u03c2",upvarphi:"\u03c6",Upgamma:"\u0393",Updelta:"\u0394",Uptheta:"\u0398",Uplambda:"\u039b",Upxi:"\u039e",Uppi:"\u03a0",Upsigma:"\u03a3",Upupsilon:"\u03a5",Upphi:"\u03a6",Uppsi:"\u03a8",Upomega:"\u03a9"}),t.UpgreekConfiguration=p.Configuration.create("upgreek",{handler:{macro:["upgreek"]}})},955:function(a,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseResult=MathJax._.input.tex.SymbolMap.parseResult,t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TexConstant=MathJax._.input.tex.TexConstants.TexConstant}},n={};function o(a){var t=n[a];if(void 0!==t)return t.exports;var e=n[a]={exports:{}};return p[a](e,e.exports,o),e.exports}a=o(955),t=o(667),e=o(927),MathJax.loader&&MathJax.loader.checkVersion("[tex]/upgreek",t.q,"tex-extension"),(0,a.r8)({_:{input:{tex:{upgreek:{UpgreekConfiguration:e}}}}})}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/input/tex/extensions/verb.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,a,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},768:function(t,e,a){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VerbConfiguration=e.VerbMethods=void 0;var o=a(251),r=a(108),i=a(871),u=n(a(402));e.VerbMethods={},e.VerbMethods.Verb=function(t,e){var a=t.GetNext(),n=++t.i;if(""===a)throw new u.default("MissingArgFor","Missing argument for %1",e);for(;t.i=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var a,n,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.loadLatest=void 0;var n=new Map([["cdnjs.cloudflare.com",{api:"https://api.cdnjs.com/libraries/mathjax?fields=version",key:"version",base:"https://cdnjs.cloudflare.com/ajax/libs/mathjax/"}],["rawcdn.githack.com",{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",key:"tag_name",base:"https://rawcdn.githack.com/mathjax/MathJax/"}],["gitcdn.xyz",{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",key:"tag_name",base:"https://gitcdn.xyz/mathjax/MathJax/"}],["cdn.statically.io",{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",key:"tag_name",base:"https://cdn.statically.io/gh/mathjax/MathJax/"}],["unpkg.com",{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",key:"tag_name",base:"https://unpkg.com/mathjax@"}],["cdn.jsdelivr.net",{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",key:"tag_name",base:"https://cdn.jsdelivr.net/npm/mathjax@"}]]),o={api:"https://api.github.com/repos/mathjax/mathjax/releases",key:"tag_name"},i="mjx-latest-version",c=null;function s(t){console&&console.error&&console.error("MathJax(latest.js): "+t)}function l(t,e){void 0===e&&(e=null),t.parentNode.removeChild(t);var r=t.src,a=r.replace(/.*?\/latest\.js(\?|$)/,"");""===a&&(a="startup.js",r=r.replace(/\?$/,"")+"?"+a);var n=(r.match(/(\d+\.\d+\.\d+)(\/es\d+)?\/latest.js\?/)||["",""])[1],o=(r.match(/(\/es\d+)\/latest.js\?/)||["",""])[1]||"";return{tag:t,src:r,id:t.id,version:n,dir:o,file:a,cdn:e}}function u(t){var e,a;try{for(var o=r(n.keys()),i=o.next();!i.done;i=o.next()){var c=i.value,s=n.get(c),u=s.base,d=t.src;if(d&&d.substr(0,u.length)===u&&d.match(/\/latest\.js(\?|$)/))return l(t,s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(a=o.return)&&a.call(o)}finally{if(e)throw e.error}}return null}function d(t,e){var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,e&&(r.id=e);var a=document.head||document.getElementsByTagName("head")[0]||document.body;a?a.appendChild(r):s("Can't find the document element")}function h(){c?d(c.src.replace(/\/latest\.js\?/,"/"),c.id):s("Can't determine the URL for loading MathJax")}function f(t){c.version&&c.version!==t&&(c.file="latest.js?"+c.file),d(c.cdn.base+t+c.dir+"/"+c.file,c.id)}function p(t){return 3===parseInt(t.split(/\./)[0])&&!t.match(/-(beta|rc)/)&&(function(t){try{var e=t+" "+Date.now();localStorage.setItem(i,e)}catch(t){}}(t),f(t),!0)}function m(t,e,r){var a=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject){try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(t){}try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}return null}();a?(a.onreadystatechange=function(){4===a.readyState&&(200===a.status?!e(JSON.parse(a.responseText))&&r():(s("Problem acquiring MathJax version: status = "+a.status),r()))},a.open("GET",t.api,!0),a.send(null)):(s("Can't create XMLHttpRequest object"),r())}function y(){m(c.cdn,(function(t){return t instanceof Array&&(t=t[0]),p(t[c.cdn.key])||m(o,(function(t){var e,a;if(!(t instanceof Array))return!1;try{for(var n=r(t),i=n.next();!i.done;i=n.next())if(p(i.value[o.key]))return!0}catch(t){e={error:t}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(e)throw e.error}}return!1}),h),!0}),h)}e.loadLatest=function(){if((c=function(){var t,e;if(document.currentScript)return l(document.currentScript);var a=document.getElementById("MathJax-script");if(a&&"script"===a.nodeName.toLowerCase())return u(a);var n=document.getElementsByTagName("script");try{for(var o=r(Array.from(n)),i=o.next();!i.done;i=o.next()){var c=u(i.value);if(c)return c}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return null}())&&c.cdn){var t=function(){try{var t=a(localStorage.getItem(i).split(/ /),2),e=t[0],r=t[1];if(r&&Date.now()-parseInt(r)<6048e5)return e}catch(t){}return null}();t?f(t):y()}else h()}}},e={};function r(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={exports:{}};return t[a].call(o.exports,o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var a in e)r.o(e,a)&&!r.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},(0,r(907).loadLatest)()}(); -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Zero.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/docs/source/_static/mathjax/output/chtml/fonts/woff-v2/MathJax_Zero.woff -------------------------------------------------------------------------------- /docs/source/_static/mathjax/ui/lazy.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t,e,r,a={306:function(t,e){e.q=void 0,e.q="3.2.2"},335:function(t,e,r){var a,n=this&&this.__extends||(a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},a(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,r=1,a=arguments.length;r0&&n[n.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]0)&&!(a=o.next()).done;)i.push(a.value)}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},y=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var a,n=0,o=e.length;n=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.LazyHandler=e.LazyMathDocumentMixin=e.LazyMathItemMixin=e.LAZYID=e.LazyList=void 0;var c=r(769),h=r(239),p=function(){function t(){this.id=0,this.items=new Map}return t.prototype.add=function(t){var e=String(this.id++);return this.items.set(e,t),e},t.prototype.get=function(t){return this.items.get(t)},t.prototype.delete=function(t){return this.items.delete(t)},t}();function f(t){return function(t){function r(){for(var e=[],r=0;r=n&&(this.lazyAlwaysIndex=0)}while(this.lazyAlwaysIndex!==a)}return!1},r.prototype.state=function(e,r){return void 0===r&&(r=!1),t.prototype.state.call(this,e,r),e= 3.8 11 | `NumPy`_ < 1.22.0 12 | `SciPy`_ >= 1.1 13 | `ase`_ >= 3.18.0 14 | ========================== ========= 15 | 16 | .. _Python: https://www.python.org/ 17 | .. _Numpy: https://docs.scipy.org/doc/numpy/reference/ 18 | .. _SciPy: https://docs.scipy.org/doc/scipy/reference/ 19 | .. _ase: https://wiki.fysik.dtu.dk/ase/index.html 20 | 21 | 22 | By pip 23 | ------ 24 | 25 | .. code:: shell 26 | 27 | $ pip install git+https://github.com/bigd4/PyNEP.git 28 | 29 | By setup.py 30 | ----------- 31 | 32 | .. code:: shell 33 | 34 | $ git clone --recursive https://github.com/bigd4/PyNEP.git 35 | $ cd pynep 36 | $ python setup.py install 37 | 38 | From Source 39 | ----------- 40 | 41 | .. code:: shell 42 | 43 | $ git clone --recursive https://github.com/bigd4/PyNEP.git 44 | $ pip install -r requirements.txt 45 | $ cd pynep/nep_cpu 46 | $ mkdir build 47 | $ cd build 48 | $ cmake .. && make 49 | $ cp nep.so ../../pynep 50 | 51 | Add ``PyNEP`` to your ``PYTHONPATH`` environment variable in your ``~/.bashrc`` file. 52 | 53 | .. code:: shell 54 | 55 | $ export PYTHONPATH=:$PYTHONPATH 56 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | pynep 2 | ===== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | pynep 8 | -------------------------------------------------------------------------------- /docs/source/pynep.rst: -------------------------------------------------------------------------------- 1 | pynep package 2 | ============= 3 | 4 | Submodules 5 | ---------- 6 | 7 | pynep.calculate module 8 | ---------------------- 9 | 10 | .. automodule:: pynep.calculate 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | pynep.io module 16 | --------------- 17 | 18 | .. automodule:: pynep.io 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | pynep.mutate module 24 | ------------------- 25 | 26 | .. automodule:: pynep.mutate 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | pynep.nep module 32 | ---------------- 33 | 34 | .. automodule:: pynep.nep 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | pynep.phono module 40 | ------------------ 41 | 42 | .. automodule:: pynep.phono 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | pynep.select module 48 | ------------------- 49 | 50 | .. automodule:: pynep.select 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | Module contents 56 | --------------- 57 | 58 | .. automodule:: pynep 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | -------------------------------------------------------------------------------- /examples/README.rst: -------------------------------------------------------------------------------- 1 | Examples 2 | ================== 3 | 4 | Some examples of PyNEP 5 | -------------------------------------------------------------------------------- /examples/data.traj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/examples/data.traj -------------------------------------------------------------------------------- /examples/mutate.py: -------------------------------------------------------------------------------- 1 | """ 2 | Mutation 3 | =========================== 4 | 5 | This example shows how to mutate structures including Rattle, Strain, Swap, ChangeAtomType 6 | """ 7 | from pynep.mutate import Combine, Rattle, Strain, Swap, ChangeAtomType 8 | from ase.io import read, write 9 | from pynep.io import load_nep 10 | 11 | 12 | frames = read('data.traj', '::10') 13 | print("read {} structures".format(len(frames))) 14 | rattle_mutate = Rattle(probability=0.8, # rattle probability of each atom 15 | rattle_range=1.5, # atoms will only rattle in this range 16 | d_ratio=0.7, # min distance controlled by d_ratio * covalent_radii 17 | min_dis_mat=None, # min distance dict such as {('C', 'C'): 1.} 18 | # if this is given, d_ratio will be ignored 19 | attempt_number=20) 20 | strain_mutate = Strain(cell_cut=1., # max value of strain matrix 21 | sigma=0.1, # sigma of gaussian 22 | d_ratio=0.7, 23 | min_dis_mat={('C', 'C'): 1.}, # d_ratio=0.7 will be ignored 24 | attempt_number=20) 25 | 26 | mutate = Combine(rattle_mutate, strain_mutate) # you can combine a series of mutations 27 | newframes = [] 28 | for atoms in frames: 29 | newframes.extend(mutate.generate(atoms, 10)) 30 | print("generate {} mutated structures".format(len(newframes))) 31 | write('new.traj', newframes) 32 | 33 | 34 | # swap mutation swap atoms with different type, so the formula won't change 35 | frames = load_nep('PbTe.in')[::10] 36 | print("read {} structures".format(len(frames))) 37 | 38 | swap_mutate = Swap(swap_probability=0.1, # max swap number is swap_probability * N_atoms 39 | d_ratio=0.7, 40 | min_dis_mat=None, 41 | attempt_number=20) 42 | newframes = [] 43 | for atoms in frames: 44 | newframes.extend(swap_mutate.generate(atoms, 5)) 45 | print("generate {} mutated structures".format(len(newframes))) 46 | write('swap.traj', newframes) 47 | 48 | # change mutation just randomly change each atom's symbol to another so the formula may change 49 | change_mutate = ChangeAtomType(change_probability=0.5, # change probability of each atom 50 | d_ratio=0.7, 51 | min_dis_mat=None, 52 | attempt_number=20) 53 | newframes = [] 54 | for atoms in frames: 55 | newframes.extend(change_mutate.generate(atoms, 2)) 56 | print("generate {} mutated structures".format(len(newframes))) 57 | write('change.traj', newframes) 58 | -------------------------------------------------------------------------------- /examples/plot_calcefs.py: -------------------------------------------------------------------------------- 1 | """ 2 | NEP vs DFT results 3 | =========================== 4 | 5 | This example show how to calculate energy, forces and stress of structures and compare them with DFT results 6 | """ 7 | from pynep.calculate import NEP 8 | from ase.io import read 9 | import numpy as np 10 | import matplotlib.pyplot as plt 11 | import matplotlib.ticker as ticker 12 | 13 | 14 | def plot_e(ed, er): 15 | fig = plt.figure() 16 | # plt.xticks(fontname="Arial", weight='bold') 17 | plt.title("NEP energy vs DFT energy", fontsize=16) 18 | ed = ed - np.mean(ed) 19 | er = er - np.mean(er) 20 | ax = plt.gca() 21 | ax.set_aspect(1) 22 | xmajorLocator = ticker.MaxNLocator(5) 23 | ymajorLocator = ticker.MaxNLocator(5) 24 | ax.xaxis.set_major_locator(xmajorLocator) 25 | ax.yaxis.set_major_locator(ymajorLocator) 26 | 27 | ymajorFormatter = ticker.FormatStrFormatter('%.1f') 28 | xmajorFormatter = ticker.FormatStrFormatter('%.1f') 29 | ax.xaxis.set_major_formatter(xmajorFormatter) 30 | ax.yaxis.set_major_formatter(ymajorFormatter) 31 | 32 | ax.set_xlabel('DFT energy (eV/atom)', fontsize=14) 33 | ax.set_ylabel('NEP energy (eV/atom)', fontsize=14) 34 | 35 | ax.spines['bottom'].set_linewidth(3) 36 | ax.spines['left'].set_linewidth(3) 37 | ax.spines['right'].set_linewidth(3) 38 | ax.spines['top'].set_linewidth(3) 39 | ax.tick_params(labelsize=16) 40 | 41 | 42 | plt.plot([np.min(ed), np.max(ed)], [np.min(er), np.max(er)], 43 | color='black',linewidth=3,linestyle='--',) 44 | plt.scatter(ed, er, zorder=200) 45 | 46 | m1 = min(np.min(ed), np.min(er)) 47 | m2 = max(np.max(ed), np.max(er)) 48 | ax.set_xlim(m1, m2) 49 | ax.set_ylim(m1, m2) 50 | 51 | rmse = np.sqrt(np.mean((ed-er)**2)) 52 | plt.text(np.min(ed) * 0.85 + np.max(ed) * 0.15, 53 | np.min(er) * 0.15 + np.max(ed) * 0.85, 54 | "RMSE: {:.3f} eV/atom".format(rmse), fontsize=14) 55 | plt.savefig('e.png') 56 | return fig 57 | 58 | 59 | def plot_f(fd, fr): 60 | fig = plt.figure() 61 | ax = plt.gca() 62 | plt.title("NEP forces vs DFT forces", fontsize=16) 63 | ax.set_aspect(1) 64 | xmajorLocator = ticker.MaxNLocator(5) 65 | ymajorLocator = ticker.MaxNLocator(5) 66 | ax.xaxis.set_major_locator(xmajorLocator) 67 | ax.yaxis.set_major_locator(ymajorLocator) 68 | 69 | ymajorFormatter = ticker.FormatStrFormatter('%.1f') 70 | xmajorFormatter = ticker.FormatStrFormatter('%.1f') 71 | ax.xaxis.set_major_formatter(xmajorFormatter) 72 | ax.yaxis.set_major_formatter(ymajorFormatter) 73 | 74 | ax.set_xlabel('DFT forces (eV/A)', fontsize=14) 75 | ax.set_ylabel('NEP forces (eV/A)', fontsize=14) 76 | 77 | ax.spines['bottom'].set_linewidth(2) 78 | ax.spines['left'].set_linewidth(2) 79 | ax.spines['right'].set_linewidth(2) 80 | ax.spines['top'].set_linewidth(2) 81 | 82 | ax.tick_params(labelsize=14) 83 | 84 | ax.set_xlim(np.min(fd), np.max(fd)) 85 | ax.set_ylim(np.min(fr), np.max(fr)) 86 | 87 | plt.plot([np.min(fd), np.max(fd)], [np.min(fr), np.max(fr)], 88 | color='black',linewidth=2,linestyle='--') 89 | plt.scatter(fd.reshape(-1), fr.reshape(-1), s=2) 90 | 91 | m1 = min(np.min(fd), np.min(fr)) 92 | m2 = max(np.max(fd), np.max(fr)) 93 | ax.set_xlim(m1, m2) 94 | ax.set_ylim(m1, m2) 95 | 96 | rmse = np.sqrt(np.mean((fd-fr)**2)) 97 | plt.text(np.min(fd) * 0.85 + np.max(fd) * 0.15, 98 | np.min(fr) * 0.15 + np.max(fr) * 0.85, 99 | "RMSE: {:.3f} eV/A".format(rmse), fontsize=14) 100 | plt.savefig('f.png') 101 | return fig 102 | 103 | a = read('data.traj', ':') 104 | calc = NEP("C_2022_NEP3.txt") 105 | print(calc) 106 | e1, e2, f1, f2 = [], [], [], [] 107 | for i in a: 108 | i.set_calculator(calc) 109 | e1.append(i.get_potential_energy() / len(i)) 110 | e2.append(i.info['energy'] / len(i)) 111 | f1.append(i.get_forces().reshape(-1)) 112 | f2.append(i.info['forces'].reshape(-1)) 113 | e1 = np.array(e1) 114 | e2 = np.array(e2) 115 | f1 = np.concatenate(f1) 116 | f2 = np.concatenate(f2) 117 | plot_e(e2, e1) 118 | plot_f(f2, f1) 119 | 120 | -------------------------------------------------------------------------------- /examples/plot_errorvsdistance.py: -------------------------------------------------------------------------------- 1 | """ 2 | Relationship between error and latent distance 3 | =============================================== 4 | 5 | Distances in latent space does not provide an error estimate in the units of the 6 | property being predicted. So we calibrate the error estimate by ftting the predictive variance to 7 | a simple conditional Gaussian distribution of the error similar to 8 | `A quantitative uncertainty metric controls error in neural network-driven chemical discovery 9 | `_ 10 | 11 | Here we took carbon for example: 12 | """ 13 | 14 | from cProfile import label 15 | from pynep.io import load_nep 16 | from pynep.calculate import NEP 17 | import numpy as np 18 | from scipy.spatial.distance import cdist 19 | from scipy.optimize import minimize 20 | import matplotlib.pyplot as plt 21 | 22 | 23 | calc = NEP('C_2022_NEP3.txt') 24 | train_data = load_nep('train.in') 25 | test_data = load_nep('test.in') 26 | train_lat = np.concatenate([calc.get_property('latent', atoms) for atoms in train_data]) 27 | #%% 28 | # We use 10% testset to calculate the force error and the min distance to train data of each atoms 29 | 30 | def split_dataset(dataset, ratio=0.1): 31 | indices = np.arange(len(dataset)) 32 | np.random.shuffle(indices) 33 | num = int(len(dataset) * ratio) 34 | return dataset[:num], dataset[num:] 35 | d1, d2 = split_dataset(test_data) 36 | 37 | d, e = [], [] 38 | for atoms in d1: 39 | nep_forces = calc.get_forces(atoms) 40 | dft_forces = atoms.info['forces'] 41 | error = np.sqrt(np.sum((nep_forces - dft_forces) ** 2, axis=1)).tolist() 42 | lat = calc.get_property('latent', atoms) 43 | mind = np.min(cdist(lat, train_lat), axis=1).tolist() 44 | d.extend(mind) 45 | e.extend(error) 46 | d = np.array(d) # min distances to trainset 47 | e = np.array(e) # errors between nep and dft 48 | 49 | #%% 50 | # Here we suppose :math:`\sigma = a + b \cdot d + c \cdot d^2`, and a, b, c > 0. 51 | # Maximize :math:`\mathcal{N}(\epsilon \vert 0, \sigma)` is same to minimize 52 | # :math:`2 \cdot ln(\sigma) + d^2/\sigma^2` 53 | 54 | def loss(args): 55 | a, b, c = args 56 | sigma = np.abs(a + b * d + c * d ** 2) 57 | l = np.sum(2 * np.log(sigma) + (e / sigma) ** 2) 58 | return l 59 | 60 | cons = ( 61 | {'type': 'ineq', 'fun': lambda x: x - 0.0001}, 62 | ) 63 | 64 | x0 = np.array([1, 1, 1]) 65 | res = minimize(loss, x0, constraints=cons, method='SLSQP') 66 | 67 | #%% 68 | # results 69 | d_, e_ = [], [] 70 | for atoms in d2[::10]: 71 | nep_forces = calc.get_forces(atoms) 72 | dft_forces = atoms.info['forces'] 73 | error = np.sqrt(np.sum((nep_forces - dft_forces) ** 2, axis=1)).tolist() 74 | 75 | lat = calc.get_property('latent', atoms) 76 | mind = np.min(cdist(lat, train_lat), axis=1).tolist() 77 | 78 | d_.extend(mind) 79 | e_.extend(error) 80 | 81 | 82 | d_ = np.array(d_) 83 | e_ = np.array(e_) 84 | sigma_ = res.x[0] + res.x[1] * d_ + res.x[2] * d_ ** 2 85 | s1 = len(e_[e_ < sigma_]) / len(e_) 86 | s2 = len(e_[e_ < 2 * sigma_]) / len(e_) 87 | plt.scatter(d_, e_, s=4) 88 | 89 | dd = np.linspace(0, max(d_) + 0.1, 100) 90 | sigma = res.x[0] + res.x[1] * dd + res.x[2] * dd ** 2 91 | plt.fill_between(dd, sigma, facecolor='blue', alpha=0.3, 92 | label="{:.2%}".format(s1)) 93 | plt.fill_between(dd, 2 * sigma, sigma, facecolor='yellow', alpha=0.3, 94 | label="{:.2%}".format(s2 - s1)) 95 | plt.legend() 96 | -------------------------------------------------------------------------------- /examples/plot_select_structure.py: -------------------------------------------------------------------------------- 1 | """ 2 | Select structures 3 | =========================== 4 | 5 | This example shows how to select structures from dataset 6 | """ 7 | from pynep.calculate import NEP 8 | from pynep.select import FarthestPointSample 9 | from ase.io import read, write 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | from sklearn.decomposition import PCA 13 | 14 | 15 | a = read("data.traj", ":") 16 | calc = NEP("C_2022_NEP3.txt") 17 | print(calc) 18 | des = np.array([np.mean(calc.get_descriptor(i), axis=0) for i in a]) 19 | sampler = FarthestPointSample(min_distance=0.05) 20 | selected_i = sampler.select(des, []) 21 | write("selected.traj", [a[i] for i in selected_i]) 22 | 23 | reducer = PCA(n_components=2) 24 | reducer.fit(des) 25 | proj = reducer.transform(des) 26 | plt.scatter(proj[:, 0], proj[:, 1], label="all data") 27 | selected_proj = reducer.transform(np.array([des[i] for i in selected_i])) 28 | plt.scatter(selected_proj[:, 0], selected_proj[:, 1], label="selected data") 29 | plt.legend() 30 | plt.axis("off") 31 | plt.savefig("select.png") 32 | -------------------------------------------------------------------------------- /examples/selected.traj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigd4/PyNEP/cb27ea96bbcacd658b230a28ec0f205d25be0a17/examples/selected.traj -------------------------------------------------------------------------------- /examples/shuf_xyz.py: -------------------------------------------------------------------------------- 1 | """ 2 | Shuffle XYZ 3 | =========================== 4 | 5 | This example shows how to shuffle structures randomly 6 | 7 | provided by Kick-H 8 | """ 9 | from pynep.io import load_nep,dump_nep 10 | import random 11 | 12 | train_ratio = 0.8 13 | rand = True 14 | 15 | train_data = load_nep('train.in') 16 | 17 | nframes = [i for i in range(len(train_data))] 18 | if rand: random.shuffle(nframes) 19 | 20 | train_frame = nframes[:int(len(train_data)*train_ratio)] 21 | dump_nep('train.xyz', [train_data[i] for i in train_frame], ftype="exyz") 22 | 23 | test_frame = nframes[int(len(train_data)*train_ratio):] 24 | dump_nep('test.xyz', [train_data[i] for i in test_frame], ftype="exyz") 25 | -------------------------------------------------------------------------------- /interface/lammps/README.md: -------------------------------------------------------------------------------- 1 | Serial version for cpu, cannot simulate very large cell and is very very slow (about 10000 atoms/s) just for explore structures in python easily. 2 | -------------------------------------------------------------------------------- /interface/lammps/USER-NEP/install.sh: -------------------------------------------------------------------------------- 1 | # Install/unInstall package files in LAMMPS 2 | # mode = 0/1/2 for uninstall/install/update 3 | 4 | mode=$1 5 | 6 | # arg1 = file, arg2 = file it depends on 7 | 8 | action () { 9 | if (test $mode = 0) then 10 | rm -f ../$1 11 | elif (! cmp -s $1 ../$1) then 12 | if (test -z "$2" || test -e ../$2) then 13 | cp $1 .. 14 | if (test $mode = 2) then 15 | echo " updating src/$1" 16 | fi 17 | fi 18 | elif (test -n "$2") then 19 | if (test ! -e ../$2) then 20 | rm -f ../$1 21 | fi 22 | fi 23 | } 24 | 25 | # all package files with no dependencies 26 | 27 | for file in *.cpp *.h; do 28 | action $file 29 | done 30 | 31 | # edit 2 Makefile.package files to include/exclude package info 32 | 33 | # if (test $1 = 1) then 34 | 35 | # if (test -e ../Makefile.package) then 36 | # sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(-std=c++11) |' ../Makefile.package 37 | # fi 38 | 39 | # elif (test $1 = 0) then 40 | 41 | # if (test -e ../Makefile.package) then 42 | # sed -i -e 's/[^ \t]*mlip[^ \t]* //' ../Makefile.package 43 | # fi 44 | 45 | # fi 46 | -------------------------------------------------------------------------------- /interface/lammps/USER-NEP/pair_NEP.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "pair_NEP.h" 8 | #include "atom.h" 9 | #include "force.h" 10 | #include "comm.h" 11 | #include "neighbor.h" 12 | #include "neigh_request.h" 13 | #include "neigh_list.h" 14 | #include "memory.h" 15 | #include "error.h" 16 | #include "domain.h" 17 | #include "nep.h" 18 | 19 | using namespace LAMMPS_NS; 20 | 21 | PairNEP::PairNEP(LAMMPS *lmp) : Pair(lmp) 22 | { 23 | restartinfo = 0; 24 | manybody_flag = 1; 25 | 26 | single_enable = 0; 27 | 28 | inited = false; 29 | allocated = 0; 30 | } 31 | 32 | PairNEP::~PairNEP() 33 | { 34 | if (copymode) return; 35 | 36 | if (allocated) { 37 | memory->destroy(setflag); 38 | memory->destroy(cutsq); 39 | } 40 | 41 | } 42 | 43 | void PairNEP::allocate() 44 | { 45 | int n = atom->ntypes; 46 | 47 | memory->create(setflag, n+1, n+1, "pair:setflag"); 48 | for (int i = 1; i <= n; i++) 49 | for (int j = 1; j <= n; j++) 50 | setflag[i][j] = 1; 51 | 52 | memory->create(cutsq, n+1, n+1, "pair:cutsq"); 53 | 54 | allocated = 1; 55 | } 56 | 57 | void PairNEP::coeff(int narg, char **arg) 58 | { 59 | if (!allocated) allocate(); 60 | } 61 | 62 | void PairNEP::settings(int narg, char **arg) 63 | { 64 | if (narg != 1) error->all(FLERR, "Illegal pair_style command"); 65 | strcpy(model_filename, arg[0]); 66 | } 67 | 68 | void PairNEP::init_style() 69 | { 70 | int irequest = neighbor->request(this,instance_me); 71 | neighbor->requests[irequest]->half = 0; 72 | neighbor->requests[irequest]->full = 1; 73 | 74 | // if (inited) ~nep_model(); 75 | nep_model = NEP3(model_filename); 76 | inited = true; 77 | cutoff = nep_model.paramb.rc_radial; 78 | cutoffsq = cutoff * cutoff; 79 | int n = atom->ntypes; 80 | for (int i=1; i<=n; i++) 81 | for (int j=1; j<=n; j++) 82 | cutsq[i][j] = cutoffsq; 83 | 84 | if (comm->nprocs != 1) error->all(FLERR, "no parallel plz"); 85 | } 86 | 87 | double PairNEP::init_one(int i, int j) 88 | { 89 | return cutoff; 90 | } 91 | 92 | void PairNEP::compute(int eflag, int vflag) 93 | { 94 | if (eflag || vflag) ev_setup(eflag,vflag); 95 | else evflag = vflag_fdotr = eflag_global = eflag_atom = 0; 96 | 97 | double **x = atom->x; 98 | double **f = atom->f; 99 | int *atom_type_ = atom->type; 100 | int n_atoms = list->inum; 101 | 102 | std::vector lattice(9); 103 | lattice[0] = domain->xprd; lattice[3] = 0.0; lattice[6] = 0.0; 104 | lattice[1] = domain->xy; lattice[4] = domain->yprd; lattice[7] = 0.0; 105 | lattice[2] = domain->xz; lattice[5] = domain->yz; lattice[8] = domain->zprd; 106 | 107 | std::vector position(n_atoms * 3); 108 | std::vector atom_type(n_atoms); 109 | for (int i=0; i nep_energies(n_atoms); 118 | std::vector nep_forces(n_atoms * 3); 119 | std::vector nep_virials(n_atoms * 9); 120 | 121 | nep_model.compute(atom_type, lattice, position, nep_energies, nep_forces, nep_virials); 122 | 123 | for (int i=0; i 12 | #include "nep.h" 13 | 14 | namespace LAMMPS_NS 15 | { 16 | class PairNEP : public Pair 17 | { 18 | public: 19 | double cutoff; 20 | NEP3 nep_model; 21 | PairNEP(class LAMMPS *); 22 | virtual ~PairNEP(); 23 | virtual void coeff(int, char **); 24 | virtual void settings(int, char **); 25 | virtual double init_one(int, int); 26 | virtual void init_style(); 27 | virtual void compute(int, int); 28 | 29 | protected: 30 | bool inited; 31 | char model_filename[1000]; 32 | double cutoffsq; 33 | void allocate(); 34 | }; 35 | } 36 | 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /interface/lammps/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PYNEP_PATH=$1 3 | LAMMPS_PATH=$2 4 | curdir=$(pwd) 5 | cp $PYNEP_PATH/nep_cpu/src/nep.* $PYNEP_PATH/inference/lammps/USER-NEP/ 6 | cp -r $PYNEP_PATH/inference/lammps/USER-NEP/ $LAMMPS_PATH/src 7 | cd $LAMMPS_PATH/src 8 | make clean-serial 9 | make no-user-nep 10 | make yes-user-nep 11 | make serial 12 | mv lmp_serial $curdir 13 | -------------------------------------------------------------------------------- /nep_cpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(GenerateNew LANGUAGES CXX) 3 | 4 | find_package(Python COMPONENTS Interpreter Development REQUIRED) 5 | add_subdirectory(../pybind11 pybind11_binary) 6 | 7 | pybind11_add_module(nep src/pynep.cpp src/nep.cpp) 8 | -------------------------------------------------------------------------------- /nep_cpu/build.sh: -------------------------------------------------------------------------------- 1 | c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) src/pynep.cpp src/nep.cpp -o nep$(python3-config --extension-suffix) 2 | -------------------------------------------------------------------------------- /nep_cpu/src/nep.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 Zheyong Fan, Junjie Wang, Eric Lindgren 3 | This file is part of NEP_CPU. 4 | NEP_CPU is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | NEP_CPU is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License 13 | along with NEP_CPU. If not, see . 14 | */ 15 | 16 | #pragma once 17 | #include 18 | #include 19 | 20 | // #define USE_TABLE_FOR_RADIAL_FUNCTIONS 21 | 22 | class NEP3 23 | { 24 | public: 25 | struct ParaMB { 26 | bool use_typewise_cutoff = false; 27 | bool use_typewise_cutoff_zbl = false; 28 | double typewise_cutoff_radial_factor = 2.5; 29 | double typewise_cutoff_angular_factor = 2.0; 30 | double typewise_cutoff_zbl_factor = 0.65; 31 | 32 | int model_type = 0; // 0=potential, 1=dipole, 2=polarizability 33 | int version = 4; 34 | double rc_radial = 0.0; 35 | double rc_angular = 0.0; 36 | double rcinv_radial = 0.0; 37 | double rcinv_angular = 0.0; 38 | int n_max_radial = 0; 39 | int n_max_angular = 0; 40 | int L_max = 0; 41 | int dim_angular; 42 | int num_L; 43 | int basis_size_radial = 8; 44 | int basis_size_angular = 8; 45 | int num_types_sq = 0; 46 | int num_c_radial = 0; 47 | int num_types = 0; 48 | double q_scaler[140]; 49 | int atomic_numbers[94]; 50 | }; 51 | 52 | struct ANN { 53 | int dim = 0; 54 | int num_neurons1 = 0; 55 | int num_para = 0; 56 | int num_para_ann = 0; 57 | const double* w0[94]; 58 | const double* b0[94]; 59 | const double* w1[94]; 60 | const double* b1; 61 | const double* c; 62 | // for the scalar part of polarizability 63 | const double* w0_pol[94]; 64 | const double* b0_pol[94]; 65 | const double* w1_pol[94]; 66 | const double* b1_pol; 67 | }; 68 | 69 | struct ZBL { 70 | bool enabled = false; 71 | bool flexibled = false; 72 | int num_types; 73 | double rc_inner = 1.0; 74 | double rc_outer = 2.0; 75 | double para[550]; 76 | }; 77 | 78 | struct DFTD3 { 79 | double s6 = 0.0; 80 | double s8 = 0.0; 81 | double a1 = 0.0; 82 | double a2 = 0.0; 83 | double rc_radial = 20.0; 84 | double rc_angular = 10.0; 85 | int atomic_number[94]; // H to Pu 86 | std::vector cn; 87 | std::vector dc6_sum; 88 | std::vector dc8_sum; 89 | }; 90 | 91 | NEP3(); 92 | NEP3(const std::string& potential_filename); 93 | 94 | void init_from_file(const std::string& potential_filename, const bool is_rank_0); 95 | 96 | void update_type_map(const int ntype, int* type_map, char** elements); 97 | 98 | // type[num_atoms] should be integers 0, 1, ..., mapping to the atom types in nep.txt in order 99 | // box[9] is ordered as ax, bx, cx, ay, by, cy, az, bz, cz 100 | // position[num_atoms * 3] is ordered as x[num_atoms], y[num_atoms], z[num_atoms] 101 | // potential[num_atoms] 102 | // force[num_atoms * 3] is ordered as fx[num_atoms], fy[num_atoms], fz[num_atoms] 103 | // virial[num_atoms * 9] is ordered as v_xx[num_atoms], v_xy[num_atoms], v_xz[num_atoms], 104 | // v_yx[num_atoms], v_yy[num_atoms], v_yz[num_atoms], v_zx[num_atoms], v_zy[num_atoms], 105 | // v_zz[num_atoms] 106 | // descriptor[num_atoms * dim] is ordered as d0[num_atoms], d1[num_atoms], ... 107 | 108 | void compute( 109 | const std::vector& type, 110 | const std::vector& box, 111 | const std::vector& position, 112 | std::vector& potential, 113 | std::vector& force, 114 | std::vector& virial); 115 | 116 | void compute_with_dftd3( 117 | const std::string& xc, 118 | const double rc_potential, 119 | const double rc_coordination_number, 120 | const std::vector& type, 121 | const std::vector& box, 122 | const std::vector& position, 123 | std::vector& potential, 124 | std::vector& force, 125 | std::vector& virial); 126 | 127 | void compute_dftd3( 128 | const std::string& xc, 129 | const double rc_potential, 130 | const double rc_coordination_number, 131 | const std::vector& type, 132 | const std::vector& box, 133 | const std::vector& position, 134 | std::vector& potential, 135 | std::vector& force, 136 | std::vector& virial); 137 | 138 | void find_descriptor( 139 | const std::vector& type, 140 | const std::vector& box, 141 | const std::vector& position, 142 | std::vector& descriptor); 143 | 144 | void find_latent_space( 145 | const std::vector& type, 146 | const std::vector& box, 147 | const std::vector& position, 148 | std::vector& latent_space); 149 | 150 | void find_B_projection( 151 | const std::vector& type, 152 | const std::vector& box, 153 | const std::vector& position, 154 | std::vector& B_projection); 155 | 156 | void find_dipole( 157 | const std::vector& type, 158 | const std::vector& box, 159 | const std::vector& position, 160 | std::vector& dipole // 3 components, for the whole box 161 | ); 162 | 163 | void find_polarizability( 164 | const std::vector& type, 165 | const std::vector& box, 166 | const std::vector& position, 167 | std::vector& polarizability // 6 components, for the whole box 168 | ); 169 | 170 | void compute_for_lammps( 171 | int nlocal, // atom->nlocal 172 | int inum, // list->inum 173 | int* ilist, // list->ilist 174 | int* numneigh, // list->numneigh 175 | int** firstneigh, // list->firstneigh 176 | int* type, // atom->type 177 | int* type_map, // map from atom type to element 178 | double** x, // atom->x 179 | double& total_potential, // total potential energy for the current processor 180 | double total_virial[6], // total virial for the current processor 181 | double* potential, // eatom or nullptr 182 | double** f, // atom->f 183 | double** virial // cvatom or nullptr 184 | ); 185 | 186 | int num_atoms = 0; 187 | int num_cells[3]; 188 | double ebox[18]; 189 | ParaMB paramb; 190 | ANN annmb; 191 | ZBL zbl; 192 | DFTD3 dftd3; 193 | std::vector NN_radial, NL_radial, NN_angular, NL_angular; 194 | std::vector r12; 195 | std::vector Fp; 196 | std::vector sum_fxyz; 197 | std::vector parameters; 198 | std::vector element_list; 199 | void update_potential(double* parameters, ANN& ann); 200 | void allocate_memory(const int N); 201 | 202 | #ifdef USE_TABLE_FOR_RADIAL_FUNCTIONS 203 | std::vector gn_radial; // tabulated gn_radial functions 204 | std::vector gnp_radial; // tabulated gnp_radial functions 205 | std::vector gn_angular; // tabulated gn_angular functions 206 | std::vector gnp_angular; // tabulated gnp_angular functions 207 | void construct_table(double* parameters); 208 | #endif 209 | 210 | bool set_dftd3_para_one( 211 | const std::string& functional_input, 212 | const std::string& functional_library, 213 | const double s6, 214 | const double a1, 215 | const double s8, 216 | const double a2); 217 | void set_dftd3_para_all( 218 | const std::string& functional_input, 219 | const double rc_potential, 220 | const double rc_coordination_number); 221 | }; 222 | -------------------------------------------------------------------------------- /nep_cpu/src/pynep.cpp: -------------------------------------------------------------------------------- 1 | #include "nep.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | namespace py = pybind11; 12 | 13 | struct Atom { 14 | int N; 15 | std::vector type; 16 | std::vector box, position, potential, force, virial, descriptor, latent, B_projection; 17 | }; 18 | 19 | class NepCalculator 20 | { 21 | public: 22 | NepCalculator(std::string); 23 | void setAtoms(int, std::vector, std::vector, std::vector); 24 | void calculate(); 25 | py::dict info; 26 | std::vector getPotentialEnergy(); 27 | std::vector getForces(); 28 | std::vector getVirials(); 29 | std::vector getDescriptors(); 30 | std::vector getLatent(); 31 | std::vector getB_projection(); 32 | 33 | private: 34 | Atom atom; 35 | NEP3 calc; 36 | std::string model_file; 37 | bool HAS_CALCULATED = false; 38 | }; 39 | 40 | NepCalculator::NepCalculator(std::string _model_file) 41 | { 42 | model_file = _model_file; 43 | py::scoped_ostream_redirect stream( 44 | std::cout, // std::ostream& 45 | py::module_::import("sys").attr("stdout") // Python output 46 | ); 47 | calc = NEP3(model_file); 48 | info["version"] = calc.paramb.version; 49 | info["zbl"] = calc.zbl.enabled; 50 | info["radial_cutoff"] = calc.paramb.rc_radial; 51 | info["angular_cutoff"] = calc.paramb.rc_angular; 52 | info["n_max_radial"] = calc.paramb.n_max_radial; 53 | info["n_max_angular"] = calc.paramb.n_max_angular; 54 | info["basis_size_radial"] = calc.paramb.basis_size_radial; 55 | info["basis_size_angular"] = calc.paramb.basis_size_angular; 56 | info["l_max_3body"] = calc.paramb.L_max; 57 | info["num_node"] = calc.annmb.dim; 58 | info["num_para"] = calc.annmb.num_para; 59 | info["element_list"] = calc.element_list; 60 | } 61 | 62 | void NepCalculator::setAtoms( 63 | int _N, std::vector _type, std::vector _box, std::vector _position) 64 | { 65 | Atom _atom; 66 | _atom.N = _N; 67 | _atom.box = _box; 68 | _atom.type = _type; 69 | _atom.position = _position; 70 | 71 | _atom.potential.resize(_atom.N); 72 | _atom.force.resize(_atom.N * 3); 73 | _atom.virial.resize(_atom.N * 9); 74 | _atom.descriptor.resize(_atom.N * calc.annmb.dim); 75 | _atom.latent.resize(_atom.N * calc.annmb.num_neurons1); 76 | atom = _atom; 77 | HAS_CALCULATED = false; 78 | } 79 | 80 | void NepCalculator::calculate() 81 | { 82 | if (!HAS_CALCULATED) { 83 | calc.compute(atom.type, atom.box, atom.position, atom.potential, atom.force, atom.virial); 84 | HAS_CALCULATED = true; 85 | } 86 | } 87 | 88 | std::vector NepCalculator::getPotentialEnergy() 89 | { 90 | calculate(); 91 | return atom.potential; 92 | } 93 | 94 | std::vector NepCalculator::getForces() 95 | { 96 | calculate(); 97 | return atom.force; 98 | } 99 | 100 | std::vector NepCalculator::getVirials() 101 | { 102 | calculate(); 103 | return atom.virial; 104 | } 105 | 106 | std::vector NepCalculator::getDescriptors() 107 | { 108 | calc.find_descriptor(atom.type, atom.box, atom.position, atom.descriptor); 109 | return atom.descriptor; 110 | } 111 | 112 | std::vector NepCalculator::getLatent() 113 | { 114 | calculate(); 115 | calc.find_latent_space(atom.type, atom.box, atom.position, atom.latent); 116 | return atom.latent; 117 | } 118 | 119 | std::vector NepCalculator::getB_projection() 120 | { 121 | atom.B_projection.resize(atom.N * calc.annmb.num_neurons1 * (calc.annmb.dim + 2)); 122 | calc.find_B_projection(atom.type, atom.box, atom.position, atom.B_projection); 123 | return atom.B_projection; 124 | } 125 | 126 | PYBIND11_MODULE(nep, m) 127 | { 128 | m.doc() = "nep"; 129 | py::class_(m, "NepCalculator") 130 | .def(py::init()) 131 | .def_readonly("info", &NepCalculator::info) 132 | .def("setAtoms", &NepCalculator::setAtoms) 133 | .def("calculate", &NepCalculator::calculate) 134 | .def("getPotentialEnergy", &NepCalculator::getPotentialEnergy) 135 | .def("getForces", &NepCalculator::getForces) 136 | .def("getVirials", &NepCalculator::getVirials) 137 | .def("getDescriptors", &NepCalculator::getDescriptors) 138 | .def("getLatent", &NepCalculator::getLatent) 139 | .def("getB_projection", &NepCalculator::getB_projection); 140 | } 141 | -------------------------------------------------------------------------------- /pynep/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.0.1" 2 | -------------------------------------------------------------------------------- /pynep/calculate.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import os, contextlib 3 | from ase.calculators.calculator import ( 4 | Calculator, 5 | all_changes, 6 | PropertyNotImplementedError, 7 | ) 8 | from .nep import NepCalculator 9 | 10 | 11 | class NEP(Calculator): 12 | 13 | """ASE calculator for NEP (see https://github.com/brucefan1983/GPUMD) 14 | supported properties: energy, forces, stress, descriptor, latent descriptor 15 | 16 | Examples: 17 | 18 | Use C_2022_NEP3.txt to calculate properties of diamond 19 | (from https://github.com/brucefan1983/GPUMD/tree/master/potentials/nepCalculate) 20 | 21 | energy, forces and stress: 22 | 23 | >>> calc = NEP('C_2022_NEP3.txt') 24 | >>> atoms = bulk('C', 'diamond', cubic=True) 25 | >>> atoms.set_calculator(calc) 26 | >>> energy = atoms.get_potential_energy() 27 | >>> forces = atoms.get_forces() 28 | >>> stress = atoms.get_stress() 29 | 30 | descriptor and latent descriptor: 31 | 32 | >>> des = calc.get_property('descriptor', atoms) 33 | >>> lat = calc.get_property('latent', atoms) 34 | """ 35 | 36 | implemented_properties = [ 37 | "energy", 38 | "energies", 39 | "forces", 40 | "stress", 41 | "descriptor", 42 | "latent", 43 | "B_projection" 44 | ] 45 | 46 | def __init__(self, model_file="nep.txt", **kwargs) -> None: 47 | """Initialize calculator 48 | 49 | Args: 50 | model_file (str, optional): filename of nep model. Defaults to "nep.txt". 51 | """ 52 | Calculator.__init__(self, **kwargs) 53 | with open(os.devnull, 'w') as devnull: 54 | with contextlib.redirect_stdout(devnull), contextlib.redirect_stderr(devnull): 55 | self.calc = NepCalculator(model_file) 56 | self.type_dict = {e: i for i, e in enumerate(self.calc.info["element_list"])} 57 | 58 | def __repr__(self): 59 | info = self.calc.info 60 | ret = "NEP {} calculator with {} symbols: ".format( 61 | info["version"], len(self.type_dict) 62 | ) 63 | info.pop("version") 64 | for key in self.type_dict: 65 | ret += key + " " 66 | ret += "\n" + "-" * 30 67 | for key, value in info.items(): 68 | ret += "\n {}: {}".format(key.ljust(20, " "), value) 69 | ret += "\n" + "-" * 30 + "\n" 70 | return ret 71 | 72 | def get_descriptor(self, atoms): 73 | Calculator.calculate(self, atoms, None, None) 74 | symbols = self.atoms.get_chemical_symbols() 75 | _type = [self.type_dict[k] for k in symbols] 76 | _box = atoms.cell.transpose(1, 0).reshape(-1).tolist() 77 | _position = atoms.get_positions().transpose(1, 0).reshape(-1).tolist() 78 | self.calc.setAtoms(len(atoms), _type, _box, _position) 79 | ret = ( 80 | np.array(self.calc.getDescriptors()).reshape(-1, len(atoms)).transpose(1, 0) 81 | ) 82 | return ret 83 | 84 | def calculate( 85 | self, 86 | atoms=None, 87 | properties=None, 88 | system_changes=all_changes, 89 | ): 90 | if properties is None: 91 | properties = self.implemented_properties 92 | 93 | Calculator.calculate(self, atoms, properties, system_changes) 94 | symbols = self.atoms.get_chemical_symbols() 95 | _type = [self.type_dict[k] for k in symbols] 96 | _box = atoms.cell.transpose(1, 0).reshape(-1).tolist() 97 | _position = atoms.get_positions().transpose(1, 0).reshape(-1).tolist() 98 | self.calc.setAtoms(len(atoms), _type, _box, _position) 99 | self.calc.calculate() 100 | self.results["energy"] = np.sum(self.calc.getPotentialEnergy()) 101 | self.results["energies"] = np.array(self.calc.getPotentialEnergy()) 102 | self.results["forces"] = ( 103 | np.array(self.calc.getForces()).reshape(3, -1).transpose(1, 0) 104 | ) 105 | 106 | if "stress" in properties: 107 | virial = np.sum(np.array(self.calc.getVirials()).reshape(9, -1), axis=1) 108 | if sum(atoms.get_pbc()) > 0: 109 | stress = -0.5 * (virial.copy() + virial.copy().T) / atoms.get_volume() 110 | self.results["stress"] = stress.flat[[0, 4, 8, 5, 2, 1]] 111 | else: 112 | raise PropertyNotImplementedError 113 | 114 | if "descriptor" in properties: 115 | self.results["descriptor"] = ( 116 | np.array(self.calc.getDescriptors()) 117 | .reshape(-1, len(atoms)) 118 | .transpose(1, 0) 119 | ) 120 | 121 | if "latent" in properties: 122 | self.results["latent"] = ( 123 | np.array(self.calc.getLatent()).reshape(-1, len(atoms)).transpose(1, 0) 124 | ) 125 | 126 | if "B_projection" in properties: 127 | self.results["B_projection"] = ( 128 | np.array(self.calc.getB_projection()).reshape(len(atoms), -1) 129 | ) 130 | 131 | 132 | class JointCalculator(Calculator): 133 | implemented_properties = [ 134 | "energy", 135 | "forces", 136 | "stress", 137 | ] 138 | 139 | def __init__(self, *args, **kwargs) -> None: 140 | Calculator.__init__(self, **kwargs) 141 | self.calc_list = args 142 | 143 | def calculate( 144 | self, 145 | atoms=None, 146 | properties=None, 147 | system_changes=all_changes, 148 | ): 149 | if properties is None: 150 | properties = self.implemented_properties 151 | 152 | Calculator.calculate(self, atoms, properties, system_changes) 153 | 154 | self.results["energy"] = 0.0 155 | self.results["forces"] = np.zeros((len(atoms), 3)) 156 | self.results["stress"] = np.zeros(6) 157 | for calc in self.calc_list: 158 | self.results["energy"] += calc.get_potential_energy(self.atoms) 159 | self.results["forces"] += calc.get_forces(self.atoms) 160 | if "stress" in properties: 161 | self.results["stress"] += calc.get_stress(self.atoms) 162 | -------------------------------------------------------------------------------- /pynep/phono.py: -------------------------------------------------------------------------------- 1 | import traceback 2 | import numpy as np 3 | import spglib 4 | import ase 5 | from ase import Atoms 6 | from ase.units import kJ, mol 7 | from ase.cell import Cell 8 | from phonopy import Phonopy 9 | from phonopy.structure.atoms import PhonopyAtoms 10 | from phonopy.phonon.band_structure import get_band_qpoints_and_path_connections 11 | from phonopy.interface.phonopy_yaml import PhonopyYaml 12 | 13 | 14 | def plot_band_structure(band_dict): 15 | import matplotlib.pyplot as plt 16 | from mpl_toolkits.axes_grid1 import ImageGrid 17 | labels_path = band_dict['labels_path'] 18 | frequencies = band_dict['frequencies'] 19 | distances = band_dict['distances'] 20 | fig = plt.figure() 21 | axs = ImageGrid(fig, 111, nrows_ncols=(1, len(labels_path)), axes_pad=0.2, label_mode="L") 22 | 23 | max_freq = max([np.max(fq) for fq in frequencies]) 24 | max_dist = distances[-1][-1] 25 | xscale = max_freq / max_dist * 1.5 26 | distances_scaled = [d * xscale for d in distances] 27 | 28 | n = 0 29 | axs[0].set_ylabel("Frequency", fontsize=14) 30 | for i, path in enumerate(labels_path): 31 | axs[i].spines['bottom'].set_linewidth(1.5) 32 | axs[i].spines['left'].set_linewidth(1.5) 33 | axs[i].spines['right'].set_linewidth(1.5) 34 | axs[i].spines['top'].set_linewidth(1.5) 35 | axs[i].tick_params(labelsize=14) 36 | xticks = [distances_scaled[n][0]] 37 | for label in path[:-1]: 38 | xticks.append(distances_scaled[n][-1]) 39 | axs[i].plot([distances_scaled[n][-1], distances_scaled[n][-1]], 40 | [0, max_freq], 41 | linewidth=2, 42 | linestyle=":", 43 | c='grey') 44 | axs[i].plot(distances_scaled[n], 45 | frequencies[n], 46 | linewidth=2, 47 | c='g') 48 | n += 1 49 | axs[i].set_xlim(xticks[0], xticks[-1]) 50 | axs[i].set_xticks(xticks) 51 | axs[i].set_xticklabels(path) 52 | axs[i].plot([xticks[0], xticks[-1]], 53 | [0, 0], 54 | linewidth=1, 55 | c='black') 56 | plt.savefig('phono.png') 57 | return axs 58 | 59 | def ase2phono(atoms): 60 | return PhonopyAtoms(symbols=atoms.get_chemical_symbols(), 61 | cell=atoms.cell.array, 62 | scaled_positions=atoms.get_scaled_positions()) 63 | 64 | def phono2ase(cell): 65 | return Atoms(symbols=cell.get_chemical_symbols(), 66 | scaled_positions=cell.get_scaled_positions(), 67 | cell=cell.get_cell(), 68 | pbc=True) 69 | 70 | class PhonoCalc: 71 | def __init__(self, calc, dim='Auto', mesh=(10, 10, 10), t_step=10, t_max=0., t_min=0.): 72 | self.calc = calc 73 | self.dim = dim 74 | self.mesh = mesh 75 | self.t_step = t_step 76 | self.t_max = t_max 77 | self.t_min = t_min 78 | 79 | def calculate(self, atoms, properties=['band', 'dos', 'pdos', 'thermal', 'ZPE']): 80 | results = {} 81 | try: 82 | print('Calculating force constants...') 83 | results['force_constants'] = self.get_force_constants(atoms) 84 | phpy_yaml = PhonopyYaml(settings= 85 | {'force_sets': True, 86 | 'displacements': True, 87 | 'force_constants': True, 88 | 'born_effective_charge': True, 89 | 'dielectric_constant': True}) 90 | phpy_yaml.set_phonon_info(self.phonon) 91 | atoms.info['phono_info'] = phpy_yaml._yaml 92 | except Exception as e: 93 | print(traceback.format_exc()) 94 | print('Fail to collect force constants') 95 | return atoms 96 | if 'band' in properties: 97 | print('Calculating band structure...') 98 | results['band_dict'] = self.get_band_structure(atoms) 99 | plot_band_structure(results['band_dict']) 100 | if 'dos' in properties: 101 | print('Calculating total dos...') 102 | results['dos_dict'] = self.get_dos() 103 | if 'pdos' in properties: 104 | print('Calculating partial dos...') 105 | results['pdos_dict'] = self.get_pdos() 106 | if 'thermal' in properties: 107 | print('Calculating thermal properties...') 108 | results['tp_dict'] = self.get_thermal(self.t_min, self.t_step, self.t_max) 109 | if 'ZPE' in properties: 110 | print('Calculating ZPE...') 111 | results['ZPE'] = self.get_thermal(0., 1., 1.)['free_energy'][0] * kJ / mol 112 | atoms.info.update(results) 113 | return atoms 114 | 115 | def get_supercell_matrix(self, atoms): 116 | if isinstance(self.dim, str): 117 | if self.dim == 'Auto': 118 | lengths = atoms.cell.lengths() 119 | return np.round(10 / lengths).astype('int').clip(1) 120 | else: 121 | return self.dim 122 | 123 | def get_force_constants(self, atoms): 124 | unitcell = ase2phono(atoms) 125 | supercell_matrix = self.get_supercell_matrix(atoms) 126 | # primitive_lattice = spglib.find_primitive(atoms)[0] 127 | # primitive_matrix = np.linalg.inv(atoms.cell[:]).T @ primitive_lattice.T 128 | self.phonon = Phonopy( 129 | unitcell=unitcell, 130 | supercell_matrix=supercell_matrix, 131 | # primitive_matrix=primitive_matrix, 132 | primitive_matrix='auto', 133 | ) 134 | self.phonon.generate_displacements(distance=0.01) 135 | supercells = self.phonon.get_supercells_with_displacements() 136 | set_of_forces = [] 137 | for cell in supercells: 138 | forces = self.calc.get_forces(phono2ase(cell)) 139 | forces -= np.mean(forces, axis=0) 140 | set_of_forces.append(forces) 141 | set_of_forces = np.array(set_of_forces) 142 | self.phonon.produce_force_constants(forces=set_of_forces) 143 | return self.phonon.force_constants 144 | 145 | def get_dos(self): 146 | self.phonon.run_mesh(self.mesh) 147 | self.phonon.run_total_dos(use_tetrahedron_method=True) 148 | return self.phonon.get_total_dos_dict() 149 | 150 | def get_pdos(self): 151 | self.phonon.run_mesh(self.mesh, with_eigenvectors=True, is_mesh_symmetry=False) 152 | self.phonon.run_projected_dos() 153 | return self.phonon.get_projected_dos_dict() 154 | 155 | def get_thermal(self, t_min, t_step, t_max): 156 | self.phonon.run_mesh(self.mesh) 157 | self.phonon.run_thermal_properties(t_min=t_min, 158 | t_step=t_step, 159 | t_max=t_max) 160 | return self.phonon.get_thermal_properties_dict() 161 | 162 | def get_band_structure(self, atoms): 163 | cell = Cell(spglib.find_primitive(atoms)[0]) 164 | special_points = cell.get_bravais_lattice().get_special_points() 165 | labels_path = ase.dft.kpoints.parse_path_string(cell.bandpath().path) 166 | labels, path = [], [] 167 | for label_path in labels_path: 168 | p = [] 169 | for l in label_path: 170 | labels.append(l) 171 | p.append(special_points[l].tolist()) 172 | path.append(p) 173 | qpoints, connections = get_band_qpoints_and_path_connections(path, npoints=51) 174 | self.phonon.run_band_structure(qpoints, path_connections=connections, labels=labels) 175 | bands_dict = self.phonon.get_band_structure_dict() 176 | bands_dict['labels_path'] = labels_path 177 | return bands_dict 178 | -------------------------------------------------------------------------------- /pynep/select.py: -------------------------------------------------------------------------------- 1 | # TODO 2 | # KDTree 3 | import numpy as np 4 | from scipy.spatial.distance import cdist 5 | 6 | 7 | class FarthestPointSample: 8 | """Farthest point sampler 9 | 10 | Example: 11 | 12 | 1. Select points from random 2d points: 13 | 14 | >>> data = np.random.randn(100000, 2) 15 | >>> selector = FarthestPointSample(min_distance=0.05) 16 | >>> indices = selector.select(data) 17 | 18 | 2. Select atoms with structure descriptors 19 | 20 | Suppose we already have frames to be selected and a NEP calculator. 21 | In fact, you can get descriptors by any other method, such as SOAP. 22 | 23 | >>> des = np.array([np.mean(calc.get_property('descriptor', atoms), axis=0) for atoms in frames]) 24 | # Use average of each atomic descriptors to get structure descriptors, shape: (Nframes, Ndescriptor) 25 | >>> sampler = FarthestPointSample() 26 | >>> indices = sampler.select(des, []) 27 | >>> selected_structures = [frames[i] for i in indices] 28 | 29 | 3. Select atoms with atomic latent descriptors 30 | 31 | >>> lat = np.concatenate([calc.get_property('latent', atoms) for atoms in frames]) 32 | # shape: (Natoms, Nlatent) 33 | >>> comesfrom = np.concatenate([[i] * len(atoms) for i, atoms in enumerate(frames)]) 34 | # shape: (Natoms, ) the ith data in lat belong to the atoms: frames[comesfrom[i]] 35 | >>> sampler = FarthestPointSample() 36 | >>> indices = [comesfrom[i] for i in sampler.select(lat, [])] 37 | >>> indices = set(indices) # remove repeated indices because two points may come from the same structure 38 | >>> selected_structures = [frames[i] for i in indices] 39 | 40 | """ 41 | def __init__(self, min_distance=0.1, metric='euclidean', metric_para={}): 42 | """Initial the sampler 43 | 44 | Args: 45 | min_distance (float, optional): minimum distance between selected data. Defaults to 0.1. 46 | metric (str, optional): metric of distance between data. 47 | Defaults to 'euclidean'. Any metric can be used by 'scipy.spatial.distance.cdist' 48 | such as 'cosine', 'minkowski' can also be used. 49 | metric_para (dict, optional): Extra arguments to metric. 50 | Defaults to {}. 51 | 52 | More information about metric can be found: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.cdist.html 53 | """ 54 | self.min_distance = min_distance 55 | self.metric = metric 56 | self.metric_para = {} 57 | 58 | def select(self, new_data, now_data=[], min_distance=None, min_select=1, max_select=None): 59 | """Select those data fartheset from given data 60 | 61 | Args: 62 | new_data (2d list or array): A series of points to be selected 63 | now_data (2d list or array): Points already in the dataset. 64 | Defaults to []. (No existed data) 65 | min_distance (float, optional): 66 | If distance between two points exceeded the minimum distance, stop the selection. 67 | Defaults to None (use the self.min_distance) 68 | min_select (int, optional): Minimal numbers of points to be selected. This may cause 69 | some distance between points less than given min_distance. 70 | Defaults to 1. 71 | max_select (int, optional): Maximum numbers of points to be selected. 72 | Defaults to None. (No limitation) 73 | 74 | Returns: 75 | A list of int: index of selected points 76 | """ 77 | min_distance = min_distance or self.min_distance 78 | max_select = max_select or len(new_data) 79 | to_add = [] 80 | if len(new_data) == 0: 81 | return to_add 82 | if len(now_data) == 0: 83 | to_add.append(0) 84 | now_data.append(new_data[0]) 85 | distances = np.min(cdist(new_data, now_data, metric=self.metric, **self.metric_para), axis=1) 86 | 87 | while np.max(distances) > min_distance or len(to_add) < min_select: 88 | i = np.argmax(distances) 89 | to_add.append(i) 90 | if len(to_add) >= max_select: 91 | break 92 | distances = np.minimum(distances, cdist([new_data[i]], new_data, metric=self.metric)[0]) 93 | return to_add 94 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=2.0 2 | ase>=3.18 3 | 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | from setuptools import setup, find_packages 3 | from setuptools.command.build_ext import build_ext 4 | from pynep import __version__ 5 | 6 | DIR = os.path.abspath(os.path.dirname(__file__)) 7 | sys.path.append(os.path.join(DIR, "pybind11")) 8 | from pybind11.setup_helpers import Pybind11Extension 9 | 10 | del sys.path[-1] 11 | 12 | 13 | # Avoid a gcc warning below: 14 | # cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid 15 | # for C/ObjC but not for C++ 16 | class BuildExt(build_ext): 17 | def build_extensions(self): 18 | # Check if the compiler is a GCC variant 19 | if self.compiler.compiler_type == "unix": 20 | if "-Wstrict-prototypes" in self.compiler.compiler_so: 21 | self.compiler.compiler_so.remove("-Wstrict-prototypes") 22 | if "-Wsign-compare" in self.compiler.compiler_so: 23 | self.compiler.compiler_so.remove("-Wsign-compare") 24 | self.compiler.compiler_so.append("-Wno-sign-compare") 25 | # Add conditions for other compiler types if necessary 26 | super().build_extensions() 27 | 28 | 29 | # generatenew 30 | module_Nep = Pybind11Extension( 31 | "pynep.nep", 32 | sources=["nep_cpu/src/pynep.cpp", "nep_cpu/src/nep.cpp"], 33 | extra_compile_args=["-std=c++11"], 34 | ) 35 | 36 | with open("README.md") as f: 37 | long_description = f.read() 38 | 39 | setup( 40 | name="pynep", 41 | version=__version__, 42 | author="Fan ZheYong, Wang Junjie", 43 | author_email="141120108@smail.nju.edu", 44 | url="https://git.nju.edu.cn/gaaooh/magus", 45 | packages=find_packages(), 46 | python_requires=">=3.8", 47 | install_requires=[ 48 | "numpy>=2.0", 49 | "ase>=3.18", 50 | ], 51 | license="MIT", 52 | description="PyNEP: Python tools for NEP", 53 | long_description=long_description, 54 | long_description_content_type="text/markdown", 55 | ext_modules=[module_Nep], 56 | cmdclass={"build_ext": BuildExt}, 57 | # entry_points={"console_scripts": [""]}, 58 | ) 59 | --------------------------------------------------------------------------------