Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
kwant
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
kwant
kwant
Commits
b0b09a24
Verified
Commit
b0b09a24
authored
1 year ago
by
Anton Akhmerov
Browse files
Options
Downloads
Patches
Plain Diff
improve sympy-ness check; closes
#425
parent
58f3620a
No related branches found
No related tags found
1 merge request
!409
Sympy compat
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/continuum/_common.py
+2
-5
2 additions, 5 deletions
kwant/continuum/_common.py
with
2 additions
and
5 deletions
kwant/continuum/_common.py
+
2
−
5
View file @
b0b09a24
...
...
@@ -16,16 +16,13 @@ import sympy.abc
import
sympy.physics.quantum
from
sympy.core.function
import
AppliedUndef
from
sympy.core.sympify
import
converter
from
sympy.core
.core
import
all_classes
as
sympy_classes
from
sympy.core
import
Basic
from
sympy.physics.matrices
import
msigma
as
_msigma
import
warnings
from
.._common
import
reraise_warnings
# TODO: remove when sympy correctly includes MutableDenseMatrix (lol).
sympy_classes
=
set
(
sympy_classes
)
|
{
sympy
.
MutableDenseMatrix
}
momentum_operators
=
sympy
.
symbols
(
'
k_x k_y k_z
'
,
commutative
=
False
)
position_operators
=
sympy
.
symbols
(
'
x y z
'
,
commutative
=
False
)
...
...
@@ -152,7 +149,7 @@ def sympify(expr, locals=None):
stored_value
=
None
# if ``expr`` is already a ``sympy`` object we may terminate a code path
if
isinstance
(
expr
,
tuple
(
sympy_classes
)
):
if
isinstance
(
expr
,
Basic
):
if
locals
:
warnings
.
warn
(
'
Input expression is already SymPy object:
'
'"
locals
"
will not be used.
'
,
...
...
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