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
eec49146
Commit
eec49146
authored
11 months ago
by
Johanna Zijderveld
Browse files
Options
Downloads
Patches
Plain Diff
Allow user k-array as input to tb_to_khamvector function
parent
f4a17849
No related branches found
No related tags found
1 merge request
!4
Interface refactoring
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
codes/tb/transforms.py
+8
-4
8 additions, 4 deletions
codes/tb/transforms.py
with
8 additions
and
4 deletions
codes/tb/transforms.py
+
8
−
4
View file @
eec49146
...
@@ -3,7 +3,7 @@ from scipy.fftpack import ifftn
...
@@ -3,7 +3,7 @@ from scipy.fftpack import ifftn
import
itertools
as
it
import
itertools
as
it
def
tb_to_khamvector
(
tb
,
nk
,
ndim
):
def
tb_to_khamvector
(
tb
,
nk
,
ndim
,
ks
=
None
):
"""
"""
Real-space tight-binding model to hamiltonian on k-space grid.
Real-space tight-binding model to hamiltonian on k-space grid.
...
@@ -22,9 +22,9 @@ def tb_to_khamvector(tb, nk, ndim):
...
@@ -22,9 +22,9 @@ def tb_to_khamvector(tb, nk, ndim):
Hamiltonian evaluated on a k-point grid.
Hamiltonian evaluated on a k-point grid.
"""
"""
if
ks
is
None
:
ks
=
np
.
linspace
(
-
np
.
pi
,
np
.
pi
,
nk
,
endpoint
=
False
)
ks
=
np
.
linspace
(
-
np
.
pi
,
np
.
pi
,
nk
,
endpoint
=
False
)
ks
=
np
.
concatenate
((
ks
[
nk
//
2
:],
ks
[:
nk
//
2
]),
axis
=
0
)
# shift for ifft
ks
=
np
.
concatenate
((
ks
[
nk
//
2
:],
ks
[:
nk
//
2
]),
axis
=
0
)
# shift for ifft
kgrid
=
np
.
meshgrid
(
*
([
ks
]
*
ndim
),
indexing
=
"
ij
"
)
kgrid
=
np
.
meshgrid
(
*
([
ks
]
*
ndim
),
indexing
=
"
ij
"
)
num_keys
=
len
(
list
(
tb
.
keys
()))
num_keys
=
len
(
list
(
tb
.
keys
()))
...
@@ -53,6 +53,10 @@ def tb_to_kfunc(tb):
...
@@ -53,6 +53,10 @@ def tb_to_kfunc(tb):
-------
-------
function
function
A function that takes a k-space vector and returns a complex np.array.
A function that takes a k-space vector and returns a complex np.array.
Notes
-----
Function doesn
'
t work for all dimensions
"""
"""
def
kfunc
(
k
):
def
kfunc
(
k
):
...
...
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