Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
qsymm
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
Container Registry
Model registry
Operate
Environments
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
qsymm
Commits
bbf422d1
Commit
bbf422d1
authored
1 year ago
by
Anton Akhmerov
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue-48' into 'master'
attempt to fix E Closes
#48
See merge request
!28
parents
f5f0faf6
5761c687
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!28
attempt to fix E
Pipeline
#158674
passed
1 year ago
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+5
-5
5 additions, 5 deletions
.gitlab-ci.yml
environment-latest.yml
+1
-1
1 addition, 1 deletion
environment-latest.yml
qsymm/kwant_continuum.py
+3
-0
3 additions, 0 deletions
qsymm/kwant_continuum.py
qsymm/model.py
+4
-4
4 additions, 4 deletions
qsymm/model.py
with
13 additions
and
10 deletions
.gitlab-ci.yml
+
5
−
5
View file @
bbf422d1
...
...
@@ -12,26 +12,26 @@ image: gitlab.kwant-project.org:5005/qt/research-docker
test minimal requirements
:
script
:
-
cond
a env create -f environment-minimal.yml
-
mamb
a env create -f environment-minimal.yml
-
source activate qsymm-minimal
-
py.test qsymm/ --cov=qsymm --verbose --cov-report term
stage
:
test
test latest requirements
:
script
:
-
cond
a env create -f environment-latest.yml
-
mamb
a env create -f environment-latest.yml
-
source activate qsymm-latest
-
py.test qsymm/ --cov=qsymm --verbose --cov-report term
stage
:
test
test kwant against latest qsymm
:
script
:
-
cond
a env create -f environment-latest.yml
-
mamb
a env create -f environment-latest.yml
-
source activate qsymm-latest
# Get bleeding-edge Kwant
-
cond
a install cython
-
mamb
a install cython
-
pip install .
# need to install qsymm so that the kwant test can find it
-
pip install git+https://gitlab.kwant-project.org/kwant/kwant.git
-
pip install git+https://gitlab.kwant-project.org/kwant/kwant.git
@stable
-
export KWANT_QSYMM_PATH=$(python -c "$KWANT_QSYMM_TEST_PATH_SCRIPT")
-
py.test $KWANT_QSYMM_PATH
stage
:
test
This diff is collapsed.
Click to expand it.
environment-latest.yml
+
1
−
1
View file @
bbf422d1
...
...
@@ -2,7 +2,7 @@ name: qsymm-latest
channels
:
-
conda-forge
dependencies
:
-
python=3.1
0
-
python=3.1
1
-
numpy
-
scipy
-
sympy
...
...
This diff is collapsed.
Click to expand it.
qsymm/kwant_continuum.py
+
3
−
0
View file @
bbf422d1
...
...
@@ -51,6 +51,7 @@ import warnings
momentum_operators
=
sympy
.
symbols
(
'
k_x k_y k_z
'
,
commutative
=
False
)
position_operators
=
sympy
.
symbols
(
'
x y z
'
,
commutative
=
False
)
e
=
sympy
.
symbols
(
'
e
'
,
positive
=
True
)
pauli
=
[
sympy
.
eye
(
2
),
_msigma
(
1
),
_msigma
(
2
),
_msigma
(
3
)]
...
...
@@ -217,6 +218,8 @@ def sympify(expr, locals=None):
# sympify we are getting list of sympy objects, so we call sympify
# second time to obtain ``sympy`` matrices.
hamiltonian
=
sympy
.
sympify
(
hamiltonian
)
# A workaround for qsymm issue #48
hamiltonian
=
hamiltonian
.
subs
(
sympy
.
sympify
(
'
e
'
),
e
)
finally
:
if
stored_value
is
not
None
:
converter
[
list
]
=
stored_value
...
...
This diff is collapsed.
Click to expand it.
qsymm/model.py
+
4
−
4
View file @
bbf422d1
...
...
@@ -19,8 +19,8 @@ from . import kwant_continuum
_commutative_momenta
=
[
kwant_continuum
.
make_commutative
(
k
,
k
)
for
k
in
kwant_continuum
.
momentum_operators
]
e
=
kwant_continuum
.
sympify
(
'
e
'
)
I
=
kwant_continuum
.
sympify
(
'
I
'
)
# noqa: E741
e
=
kwant_continuum
.
e
I
=
sympy
.
I
# noqa: E741
def
substitute_exponents
(
expr
):
...
...
@@ -671,7 +671,7 @@ class Model(UserDict):
an error is thrown.
"""
# Replace 'e' with the numerical value
expr
=
self
.
tosympy
(
nsimplify
=
nsimplify
).
subs
({
'
e
'
:
np
.
e
})
expr
=
self
.
tosympy
(
nsimplify
=
nsimplify
).
subs
({
e
:
np
.
e
})
# Needed if expr is an array with 1 element, because .tosympy
# returns a scalar then.
try
:
...
...
@@ -990,7 +990,7 @@ def _find_momenta(momenta):
@lru_cache
(
maxsize
=
1000
)
def
_symbol_normalizer
(
key
):
return
sympy
.
expand_power_exp
(
sympy
.
sympify
(
key
))
return
sympy
.
expand_power_exp
(
sympy
.
sympify
(
key
,
locals
=
{
'
e
'
:
e
}
))
@lru_cache
(
maxsize
=
1000
)
...
...
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