Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MeanFi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quantum Tinkerer
MeanFi
Commits
e9d1adf2
Commit
e9d1adf2
authored
11 months ago
by
Antonio Manesco
Browse files
Options
Downloads
Patches
Plain Diff
Combine with draft for `index.md`
parent
7549a990
No related branches found
No related tags found
1 merge request
!12
Create readme file
Pipeline
#179841
passed
11 months ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+9
-10
9 additions, 10 deletions
README.md
with
9 additions
and
10 deletions
README.md
+
9
−
10
View file @
e9d1adf2
...
...
@@ -10,10 +10,9 @@ pip install pymf
## Usage
The algorithm consists of a few simple steps. We exemplify with the one-dimensional Hubbard model with two atoms per unit cell.
1.
Define the Hamiltonian
Finding a mean-field groundstate Hamiltonian is a 4-step process. We exemplify with the one-dimensional Hubbard model with two atoms per unit cell.
1.
Define the non-interacting and interacting part of the Hamiltonian separately as hopping dictionaries.
```
python
# Hopping matrix
hopp
=
np
.
kron
(
np
.
array
([[
0
,
1
],
[
0
,
0
]]),
np
.
eye
(
2
))
...
...
@@ -24,23 +23,23 @@ U=2
s_x
=
np
.
array
([[
0
,
1
],
[
1
,
0
]])
h_int
=
{(
0
,):
U
*
np
.
kron
(
np
.
eye
(
2
),
s_x
),}
```
2.
Combine non-interacting and interacting Hamiltonians into a model.
2.
Import
`pymf`
and combine the non-interacting and interacting Hamiltonians into a
`Model`
object.
```
python
# Number of electrons per unit cell
filling
=
2
# Define model
model
=
pymf
.
Model
(
h_0
,
h_int
,
filling
)
```
3.
Compute the groundstate Hamiltonian.
3.
Provide a starting guess and the number of k-points to use the
`solver`
function and find the mean-field Hamiltonian.
```
python
# Generate a random guess
guess
=
pymf
.
generate_guess
(
frozenset
(
h_int
),
ndof
=
4
)
# Compute groundstate Hamiltonian
gs_hamiltonian
=
pymf
.
solver
(
model
,
guess
,
nk
=
nk
)
mf_sol
=
pymf
.
solver
(
model
,
guess
,
nk
=
nk
)
```
4.
Add the mean-field correction to the non-interacting part to calculate the total Hamiltonian.
```
python
h_mf
=
pymf
.
add_tb
(
h_0
,
mf_sol
)
```
# Citing `pymf`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment