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
37da1801
Commit
37da1801
authored
11 months ago
by
Kostas Vilkelis
Browse files
Options
Downloads
Patches
Plain Diff
remove xarray dependency
parent
68ab51a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Release version
Pipeline
#178546
passed
11 months ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pymf/tests/test_hubbard.py
+3
-12
3 additions, 12 deletions
pymf/tests/test_hubbard.py
with
3 additions
and
12 deletions
pymf/tests/test_hubbard.py
+
3
−
12
View file @
37da1801
# %%
import
numpy
as
np
import
pytest
import
xarray
as
xr
from
pymf.model
import
Model
from
pymf.solvers
import
solver
...
...
@@ -10,7 +9,6 @@ from pymf.tb.tb import add_tb
repeat_number
=
10
# %%
def
gap_relation_hubbard
(
Us
,
nk
,
nk_dense
,
tol
=
1e-3
):
"""
Gap relation for the Hubbard model.
...
...
@@ -39,19 +37,12 @@ def gap_relation_hubbard(Us, nk, nk_dense, tol=1e-3):
_gap
=
utils
.
compute_gap
(
add_tb
(
h_0
,
mf_sol
),
fermi_energy
=
0
,
nk
=
nk_dense
)
gaps
.
append
(
_gap
)
ds
=
xr
.
Dataset
(
data_vars
=
dict
(
gap
=
([
"
Us
"
],
gaps
)),
coords
=
dict
(
Us
=
Us
,
),
)
fit_gap
=
ds
.
gap
.
polyfit
(
dim
=
"
Us
"
,
deg
=
1
).
polyfit_coefficients
[
0
].
data
fit_gap
=
np
.
polyfit
(
Us
,
np
.
array
(
gaps
),
1
)[
0
]
assert
np
.
abs
(
fit_gap
-
1
)
<
tol
@pytest.mark.repeat
(
repeat_number
)
def
test_gap_hubbard
():
"""
Test the gap prediction for the Hubbard model.
"""
Us
=
np
.
linspace
(
0.5
,
10
,
2
0
,
endpoint
=
True
)
gap_relation_hubbard
(
Us
,
nk
=
2
0
,
nk_dense
=
100
,
tol
=
1e-2
)
Us
=
np
.
linspace
(
0.5
,
5
,
5
0
,
endpoint
=
True
)
gap_relation_hubbard
(
Us
,
nk
=
3
0
,
nk_dense
=
100
,
tol
=
1e-2
)
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