Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs/notebooks/BoundingBox.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "7408efd9",
"metadata": {},
"outputs": [],
"source": [
"import vampyr as vp\n",
"import numpy as np\n",
"epsilon = 1.0e-3\n",
"\n",
"D = 1\n",
"k = 5\n",
"N = -2\n",
"world = vp.BoundingBox(dim=1, scale=N)\n",
"mra = vp.MultiResolutionAnalysis(box=world, order=k)\n",
"\n",
"r0 = [0.8]\n",
"beta = 10.0\n",
"alpha = (beta / np.pi) ** (D / 2.0)\n",
"ffunc = vp.GaussFunc(alpha=alpha, beta=beta, position=r0)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0442bf58",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "vampyr (3.13.11)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
45 changes: 20 additions & 25 deletions docs/notebooks/PCMSolvent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 23,
"id": "ea98d79d",
"metadata": {
"tags": [
Expand Down Expand Up @@ -47,13 +47,13 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 24,
"id": "687f3715",
"metadata": {},
"outputs": [],
"source": [
"# Import necessary packages\n",
"from vampyr import vampyr3d as vp\n",
"import vampyr as vp\n",
"import numpy as np\n",
"from scipy.special import erf"
]
Expand Down Expand Up @@ -109,7 +109,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 25,
"id": "a74a3d77",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -176,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 26,
"id": "7036a9eb",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -253,7 +253,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 27,
"id": "77a9524b",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -307,7 +307,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 28,
"id": "5996cb89",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -336,7 +336,7 @@
"source": [
"k = 5\n",
"L = [-10, 10]\n",
"MRA = vp.MultiResolutionAnalysis(order=k, box=L)\n",
"MRA = vp.MultiResolutionAnalysis(dim=3, order=k, box=L)\n",
"print(MRA)"
]
},
Expand All @@ -350,7 +350,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 29,
"id": "898a27c8",
"metadata": {},
"outputs": [],
Expand All @@ -371,7 +371,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 30,
"id": "980ddc95",
"metadata": {},
"outputs": [],
Expand All @@ -392,7 +392,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 31,
"id": "84cee3c8",
"metadata": {},
"outputs": [],
Expand All @@ -415,7 +415,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 32,
"id": "c04749f8",
"metadata": {},
"outputs": [],
Expand All @@ -434,7 +434,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 33,
"id": "624ae35d",
"metadata": {},
"outputs": [],
Expand All @@ -453,7 +453,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 34,
"id": "71337e6c",
"metadata": {},
"outputs": [
Expand All @@ -470,7 +470,7 @@
"4 6.0252390e+00 1.8435902e-03 -2.6266231e-01 6.5638875e-05\n",
"5 6.0254219e+00 1.8305719e-04 -2.6266876e-01 -6.4520209e-06\n",
"6 6.0254060e+00 1.5950934e-05 -2.6266820e-01 5.5755347e-07\n",
"7 6.0254072e+00 1.2399247e-06 -2.6266825e-01 -4.3037920e-08\n"
"7 6.0254072e+00 1.2399247e-06 -2.6266825e-01 -4.3037921e-08\n"
]
}
],
Expand Down Expand Up @@ -518,17 +518,17 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 35,
"id": "50f238b2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.2626682475802428"
"-0.2626682475802452"
]
},
"execution_count": 13,
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -540,7 +540,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.11.4 ('MRPyCM-env')",
"display_name": "devv2_env (3.12.3)",
"language": "python",
"name": "python3"
},
Expand All @@ -554,12 +554,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
},
"vscode": {
"interpreter": {
"hash": "487dd71aba060d73bfc278ebf788be90cc4e85b80399312c78d8b97665a3c999"
}
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
62 changes: 36 additions & 26 deletions docs/notebooks/beryllium_atom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"tags": [
"hide-cell"
Expand Down Expand Up @@ -87,21 +87,36 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from vampyr import vampyr3d as vp\n",
"import vampyr as vp\n",
"import numpy as np\n",
"import numpy.linalg as LA\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:36: SyntaxWarning: invalid escape sequence '\\s'\n",
"<>:86: SyntaxWarning: invalid escape sequence '\\s'\n",
"<>:36: SyntaxWarning: invalid escape sequence '\\s'\n",
"<>:86: SyntaxWarning: invalid escape sequence '\\s'\n",
"/tmp/ipykernel_1553354/3248586940.py:36: SyntaxWarning: invalid escape sequence '\\s'\n",
" K(phi) = \\sum_i P[phi * psi_i] * psi_i\n",
"/tmp/ipykernel_1553354/3248586940.py:86: SyntaxWarning: invalid escape sequence '\\s'\n",
" J(phi) = \\sum_i P[psi_i * psi_i] * phi\n"
]
}
],
"source": [
"class HelmholtzOperator():\n",
" \"\"\"\n",
Expand Down Expand Up @@ -283,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -437,7 +452,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -452,7 +467,7 @@
"# Define MRA basis and computational domain\n",
"k = 5 # Polynomial order of MRA basis\n",
"world = [-20, 20] # Computational domain [-L,L]^3 (a.u.)\n",
"MRA = vp.MultiResolutionAnalysis(order=k, box=world)\n",
"MRA = vp.MultiResolutionAnalysis(dim=3, order=k, box=world)\n",
"\n",
"# Setup guess for the orbitals and the Fock matrix\n",
"Phi_n = starting_guess(mra=MRA, atom=mol[0], n_orbs=2, prec=precision)\n",
Expand All @@ -464,22 +479,22 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 | E_tot: -12.158806160497663 | dPhi: 0.9554261103233852\n",
"1 | E_tot: -13.910545962062471 | dPhi: 0.6030032083595198\n",
"2 | E_tot: -14.425154911621195 | dPhi: 0.11248971009686566\n",
"3 | E_tot: -14.550559502300937 | dPhi: 0.056367744794410625\n",
"4 | E_tot: -14.573091352701868 | dPhi: 0.024464066721782796\n",
"5 | E_tot: -14.576656010668405 | dPhi: 0.009607118621517596\n",
"6 | E_tot: -14.577184437878596 | dPhi: 0.0036909439005734903\n",
"7 | E_tot: -14.577255599761454 | dPhi: 0.0017015854922230098\n",
"8 | E_tot: -14.577262672068981 | dPhi: 0.0009093846224262461\n"
"0 | E_tot: -12.158806160497662 | dPhi: 0.9554261103233839\n",
"1 | E_tot: -13.910545962062479 | dPhi: 0.6030032083595226\n",
"2 | E_tot: -14.425154911621192 | dPhi: 0.11248971009686642\n",
"3 | E_tot: -14.550559502300938 | dPhi: 0.05636774479441057\n",
"4 | E_tot: -14.573091352701868 | dPhi: 0.02446406672178261\n",
"5 | E_tot: -14.576656010668403 | dPhi: 0.009607118621517379\n",
"6 | E_tot: -14.577184437878591 | dPhi: 0.003690943900573473\n",
"7 | E_tot: -14.57725559976145 | dPhi: 0.0017015854922230302\n",
"8 | E_tot: -14.577262672068983 | dPhi: 0.0009093846224265751\n"
]
}
],
Expand All @@ -498,7 +513,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.6 64-bit",
"display_name": "vampyr (3.13.11)",
"language": "python",
"name": "python3"
},
Expand All @@ -512,14 +527,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.13.11"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
Loading