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
17930339
Commit
17930339
authored
10 months ago
by
Kostas Vilkelis
Committed by
Johanna Zijderveld
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
rm kham_to_tb
parent
3e321ebb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Examples
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pymf/__init__.py
+1
-2
1 addition, 2 deletions
pymf/__init__.py
pymf/tb/transforms.py
+0
-48
0 additions, 48 deletions
pymf/tb/transforms.py
with
1 addition
and
50 deletions
pymf/__init__.py
+
1
−
2
View file @
17930339
...
...
@@ -14,7 +14,7 @@ from .solvers import solver
from
.model
import
Model
from
.observables
import
expectation_value
from
.tb.tb
import
add_tb
,
scale_tb
from
.tb.transforms
import
kham_to_tb
,
tb_to_khamvector
from
.tb.transforms
import
tb_to_khamvector
from
.tb.utils
import
generate_guess
,
calculate_fermi_energy
...
...
@@ -28,7 +28,6 @@ __all__ = [
"
calculate_fermi_energy
"
,
"
construct_density_matrix
"
,
"
meanfield
"
,
"
kham_to_tb
"
,
"
tb_to_khamvector
"
,
"
__version__
"
,
"
__version_tuple__
"
,
...
...
This diff is collapsed.
Click to expand it.
pymf/tb/transforms.py
+
0
−
48
View file @
17930339
...
...
@@ -62,51 +62,3 @@ def ifftn_to_tb(ifft_array: np.ndarray) -> tb_type:
keys
=
[
np
.
arange
(
-
size
[
0
]
//
2
+
1
,
size
[
0
]
//
2
)
for
i
in
range
(
len
(
size
))]
keys
=
itertools
.
product
(
*
keys
)
return
{
tuple
(
k
):
ifft_array
[
tuple
(
k
)]
for
k
in
keys
}
def
kham_to_tb
(
kham
:
np
.
ndarray
,
tb_keys
:
list
[
tuple
[
None
]
|
tuple
[
int
,
...]],
ks
:
ks_type
=
None
,
)
->
tb_type
:
"""
Convert a Hamiltonian evaluated on a k-grid to a tight-binding dictionary.
Parameters
----------
kham :
Hamiltonian sampled on a grid of k-points with shape (nk, nk, ..., ndof, ndof),
where ndof is number of internal degrees of freedom.
tb_keys :
List of keys for which to compute the tight-binding dictionary.
ks :
I have no clue why we need this, so this goes on the chopping board.
Returns
-------
:
Tight-binding model of Hartree-Fock solution.
"""
if
ks
is
not
None
:
ndim
=
len
(
kham
.
shape
)
-
2
dk
=
np
.
diff
(
ks
)[
0
]
nk
=
len
(
ks
)
k_pts
=
np
.
tile
(
ks
,
ndim
).
reshape
(
ndim
,
nk
)
k_grid
=
np
.
array
(
np
.
meshgrid
(
*
k_pts
))
k_grid
=
k_grid
.
reshape
(
k_grid
.
shape
[
0
],
np
.
prod
(
k_grid
.
shape
[
1
:]))
kham
=
kham
.
reshape
(
np
.
prod
(
kham
.
shape
[:
ndim
]),
*
kham
.
shape
[
-
2
:])
hopps
=
(
np
.
einsum
(
"
ij,jkl->ikl
"
,
np
.
exp
(
1j
*
np
.
einsum
(
"
ij,jk->ik
"
,
tb_keys
,
k_grid
)),
kham
,
)
*
(
dk
/
(
2
*
np
.
pi
))
**
ndim
)
h
=
{}
for
i
,
vector
in
enumerate
(
tb_keys
):
h
[
tuple
(
vector
)]
=
hopps
[
i
]
return
h
else
:
return
{():
kham
}
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