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
8d1396b8
Commit
8d1396b8
authored
2 years ago
by
Anton Akhmerov
Committed by
Isidora Araya
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Apply 4 suggestion(s) to 2 file(s)
parent
4cd7a01e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!23
Saving qsymm models
Pipeline
#114415
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/source/tutorial/basics.rst
+9
-6
9 additions, 6 deletions
docs/source/tutorial/basics.rst
pytest.ini
+1
-1
1 addition, 1 deletion
pytest.ini
with
10 additions
and
7 deletions
docs/source/tutorial/basics.rst
+
9
−
6
View file @
8d1396b8
...
@@ -213,20 +213,23 @@ and :ref:`tutorial_kekule`.
...
@@ -213,20 +213,23 @@ and :ref:`tutorial_kekule`.
Saving and loading Qsymm models
Saving and loading Qsymm models
-------------------------------------------------
-------------------------------------------------
We can save and load Qsymm models.
Qsymm models and identified symmetries don't guarantee consistent ordering and basis selection
across multiple runs. To avoid irrerproducible results you may use the ``Model.tosympy`` method
and serialize the resulting sympy expression as shown below.
To save we do:
To save we do:
.. jupyter-execute::
.. jupyter-execute::
H2D_s
tr = str(
H2D.tosympy(
nsimplify=True)
)
H2D_s
ympy =
H2D.tosympy()
file = open("H2D.txt", "w")
with open("H2D.txt", "w") as f:
file.write(H2D_str)
f.write(str(H2D))
file.close()
To load we do:
To load we do:
.. jupyter-execute::
.. jupyter-execute::
f = open('H2D.txt','r').read()
with open("H2D.txt") as f:
data = f.read()
loaded_H2D = qsymm.Model(sympy.parsing.sympy_parser.parse_expr(f), momenta=['k_x', 'k_z'])
loaded_H2D = qsymm.Model(sympy.parsing.sympy_parser.parse_expr(f), momenta=['k_x', 'k_z'])
This diff is collapsed.
Click to expand it.
pytest.ini
+
1
−
1
View file @
8d1396b8
...
@@ -9,4 +9,4 @@ filterwarnings =
...
@@ -9,4 +9,4 @@ filterwarnings =
# Remove once this does not need to be ignored
# Remove once this does not need to be ignored
ignore:np\.asscalar\(a\)
is
deprecated
since
NumPy
v1\.16,
use
a\.item\(\)
instead:DeprecationWarning
ignore:np\.asscalar\(a\)
is
deprecated
since
NumPy
v1\.16,
use
a\.item\(\)
instead:DeprecationWarning
# Remove once setuptools figures it out
# Remove once setuptools figures it out
ignore:lib2to3:PendingDeprecationWarning
ignore:lib2to3:PendingDeprecationWarning
\ No newline at end of file
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