Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pariser parr #139

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c2bf056
add CI to PariserParr branch
RichRick1 Jun 10, 2024
9d0b5be
Merge pull request #121 from RichRick1/PariserParr
RichRick1 Jun 10, 2024
33dfe06
changing the matrix Sxy
giovanni-br Jun 13, 2024
3bd29ca
Pariser Parr
giovanni-br Jun 14, 2024
43496a1
#116 Fixing logic of orbital_overlap
giovanni-br Jul 1, 2024
8af1393
Merge branch 'issue-116-fix' of https://github.com/giovanni-br/ModelH…
RichRick1 Jul 2, 2024
5ae0eb3
Merge pull request #126 from theochem/giovanni-br-issue-116-fix
RichRick1 Jul 2, 2024
9c80612
add comput_u func
RichRick1 Jul 3, 2024
1aeaf30
fix imports
RichRick1 Jul 3, 2024
f6123cf
change function name
RichRick1 Jul 3, 2024
bd293f4
Merge pull request #127 from RichRick1/PariserParr
RichRick1 Jul 3, 2024
8e0f0a8
Fixing problems with tests
giovanni-br Jul 3, 2024
1f055af
Merge branch 'PariserParr' of https://github.com/giovanni-br/ModelHam…
giovanni-br Jul 3, 2024
01d0113
fixing errors
giovanni-br Jul 3, 2024
1f2b1f6
rename files
giovanni-br Jul 4, 2024
c4e6cfd
fixing a logic in compute_gamma
giovanni-br Jul 4, 2024
67f0748
adding comments in the data
giovanni-br Jul 9, 2024
257fb29
Fixes #123 - Adding TJUV
giovanni-br Jul 12, 2024
878a742
Fixing errors
giovanni-br Jul 13, 2024
0985cf3
Fixing errors
giovanni-br Jul 15, 2024
e45dd24
Fixing errors 2
giovanni-br Jul 15, 2024
cf7b4cd
#130: Adding tests
giovanni-br Jul 15, 2024
b6e3e30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2024
cf37b97
#130: Adding tests
giovanni-br Jul 15, 2024
de880a7
#130: Adding tests
giovanni-br Jul 15, 2024
abce417
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2024
5ad3aa6
#130: Adding tests
giovanni-br Jul 15, 2024
bd006fa
#130: Adding tests
giovanni-br Jul 15, 2024
38f6323
#130: Adding tests and fixing problems
giovanni-br Jul 17, 2024
a67eb37
#133 and #130: Fixing symmetry
giovanni-br Jul 18, 2024
5c26051
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 18, 2024
f89e33f
#133: Improving documentation
giovanni-br Jul 23, 2024
53befed
#135 #136 adding the distance matrix and allowing gamma
giovanni-br Aug 6, 2024
ede8a25
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 6, 2024
2c44a3b
#135 #136 Fixing errors in test_tjuv.py
giovanni-br Aug 6, 2024
b6359c2
Merge branch 'PariserParr' of https://github.com/giovanni-br/ModelHam…
giovanni-br Aug 6, 2024
88b4a3b
#135 #136: Cleaning the code
giovanni-br Aug 8, 2024
681bdc7
#138: Fixing tutorials
giovanni-br Aug 14, 2024
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
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
branches:
- main
- PariserParr
pull_request:
branches: [ main ]
branches:
- main
- PariserParr

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
46 changes: 18 additions & 28 deletions examples/Demonstration.ipynb

Large diffs are not rendered by default.

72 changes: 38 additions & 34 deletions examples/Ising.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
"source": [
"## Defining Heisenberg Model\n",
"There are two ways to define the Heisenberg model using the Model Hamiltonian Package:\n",
"1. Using the connectivity of the lattice and providing the exchange couplings, $J^{ax}$, $J^{eq}$ , and $\\mu$ as a float numbers;\n",
"1. Using the adjacency of the lattice and providing the exchange couplings, $J^{ax}$, $J^{eq}$ , and $\\mu$ as a float numbers;\n",
"2. Providing exchange couplings, $J^{ax}$, $J^{eq}$ , and $\\mu$ explicitly as numpy arrays;\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# import libraries\n",
"import numpy as np\n",
"from moha import HamHeisenberg\n",
"\n",
"# Defining the Hamiltonian using connectivity matrix\n",
"# Defining the Hamiltonian using adjacency matrix\n",
"# For example, consider 6x6 lattice with periodic boundary condition\n",
"\n",
"# Define the connectivity matrix\n",
"connectivity = np.array([[0, 1, 0, 0, 0, 1],\n",
"# Define the adjacency matrix\n",
"adjacency = np.array([[0, 1, 0, 0, 0, 1],\n",
" [1, 0, 1, 0, 0, 0],\n",
" [0, 1, 0, 1, 0, 0],\n",
" [0, 0, 1, 0, 1, 0],\n",
Expand All @@ -54,12 +54,12 @@
"mu = 0\n",
"\n",
"# Define the Hamiltonian\n",
"ham = HamHeisenberg(connectivity=connectivity, J_eq=J_eq, J_ax=J_ax, mu=mu)"
"ham = HamHeisenberg(adjacency=adjacency, J_eq=J_eq, J_ax=J_ax, mu=mu)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -110,7 +110,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -190,14 +190,14 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Ground state energy per electron: -0.3564972638984237\n"
"Ground state energy per electron: -0.35649726389842346\n"
]
}
],
Expand Down Expand Up @@ -277,14 +277,18 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Ground state energy per electron: -0.35649726389842346\n"
"ename": "ModuleNotFoundError",
"evalue": "No module named 'pyscf'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[11], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyscf\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m fci\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# Constructing the XXZ Hamiltonian using the HamHeisenberg class\u001b[39;00m\n\u001b[0;32m 4\u001b[0m \n\u001b[0;32m 5\u001b[0m \u001b[38;5;66;03m# Define the Hamiltonian parameters\u001b[39;00m\n\u001b[0;32m 6\u001b[0m adjacency \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mzeros((L, L))\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pyscf'"
]
}
],
Expand All @@ -294,13 +298,13 @@
"# Constructing the XXZ Hamiltonian using the HamHeisenberg class\n",
"\n",
"# Define the Hamiltonian parameters\n",
"connectivity = np.zeros((L, L))\n",
"connectivity[np.arange(L-1), np.arange(L-1)+1] = 1\n",
"connectivity[0, -1] = 1\n",
"connectivity += connectivity.T\n",
"adjacency = np.zeros((L, L))\n",
"adjacency[np.arange(L-1), np.arange(L-1)+1] = 1\n",
"adjacency[0, -1] = 1\n",
"adjacency += adjacency.T\n",
"\n",
"# Define the Hamiltonian\n",
"ham = HamHeisenberg(connectivity=connectivity, J_eq=1, J_ax=0.2, mu=0)\n",
"ham = HamHeisenberg(adjacency=adjacency, J_eq=1, J_ax=0.2, mu=0)\n",
"e0 = ham.generate_zero_body_integral()\n",
"h1 = ham.generate_one_body_integral(dense=True, basis='spatial basis')\n",
"h2 = ham.generate_two_body_integral(dense=True, basis='spatial basis', sym=4)\n",
Expand Down Expand Up @@ -328,7 +332,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -350,14 +354,14 @@
"fig, ax = plt.subplots(1, 2, figsize=(12, 6))\n",
"\n",
"for L in range(4, 10, 2):\n",
" # Define the connectivity matrix\n",
" connectivity = np.zeros((L, L))\n",
" connectivity[np.arange(L-1), np.arange(L-1)+1] = 1\n",
" connectivity[0, -1] = 1\n",
" connectivity += connectivity.T\n",
" # Define the adjacency matrix\n",
" adjacency = np.zeros((L, L))\n",
" adjacency[np.arange(L-1), np.arange(L-1)+1] = 1\n",
" adjacency[0, -1] = 1\n",
" adjacency += adjacency.T\n",
"\n",
" # Define the Hamiltonian\n",
" ham = HamHeisenberg(connectivity=connectivity, J_eq=1, J_ax=1, mu=0)\n",
" ham = HamHeisenberg(adjacency=adjacency, J_eq=1, J_ax=1, mu=0)\n",
" e0 = ham.generate_zero_body_integral()\n",
" h1 = ham.generate_one_body_integral(dense=True, basis='spatial basis')\n",
" h2 = ham.generate_two_body_integral(dense=True, basis='spatial basis', sym=4)\n",
Expand Down Expand Up @@ -411,21 +415,21 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Constructing the XXZ Hamiltonian using the HamHeisenberg class\n",
"\n",
"# Define the Hamiltonian parameters\n",
"L = 4\n",
"connectivity = np.zeros((L, L))\n",
"connectivity[np.arange(L-1), np.arange(L-1)+1] = 1\n",
"connectivity[0, -1] = 1\n",
"connectivity += connectivity.T\n",
"adjacency = np.zeros((L, L))\n",
"adjacency[np.arange(L-1), np.arange(L-1)+1] = 1\n",
"adjacency[0, -1] = 1\n",
"adjacency += adjacency.T\n",
"\n",
"# Define the Hamiltonian\n",
"ham = HamHeisenberg(connectivity=connectivity, J_eq=1, J_ax=0.2, mu=0)\n",
"ham = HamHeisenberg(adjacency=adjacency, J_eq=1, J_ax=0.2, mu=0)\n",
"e0 = ham.generate_zero_body_integral()\n",
"h1 = ham.generate_one_body_integral(dense=True, basis='spatial basis')\n",
"h2 = ham.generate_two_body_integral(dense=True, basis='spatial basis', sym=4)\n",
Expand Down Expand Up @@ -453,7 +457,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.10.11"
}
},
"nbformat": 4,
Expand Down
Loading
Loading