Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: pytest --cov=./ --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v1

# build_windows_test:
# needs: [code_lint]
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
# run: pytest --cov=./ --cov-report=xml

# - name: Upload coverage
# uses: codecov/codecov-action@v2.0.2
# uses: codecov/codecov-action@v1

testing_windows:
needs: [code_lint]
Expand Down Expand Up @@ -148,4 +148,4 @@ jobs:
shell: pwsh
run: pytest --cov=./ --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: pytest --cov=./ --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v1

source-distribution:
needs: [build-test]
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ __pycache__/*
.Python
build/
.vscode/*
.idea/*
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -106,7 +105,6 @@ tests/simpson/quad/**
version/
docs/examples/
docs/fitting/
_temp/

# files
class-diagram*
Expand Down
11 changes: 0 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ repos:
hooks:
- id: flake8
language: python
args:
[
"--ignore=E402",
"--exclude=.eggs, *.egg,build, src/mrsimulator/__init__.py",
"--filename=*.pyx, *py",
"--max-line-length=88",
"--max-complexity=8",
"--select=B,C,E,F,W,T,N8",
"--count",
"--statistics",
]

- repo: https://github.com/asottile/reorder_python_imports
rev: v2.4.0
Expand Down
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
issue code: redefined-builtin
17 changes: 0 additions & 17 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
Upcoming Changes
----------------

What's new
''''''''''

**Method**

- New Event class---``SpectralEvent``, ``ConstantTimeEvent``, and ``MixingEvent``. The MixingEvent
controls the mixing of transitions in a multi-event method.
- A ``TransitionPathway`` object now includes a weight attribute, which holds the probability of
the transition pathway based on the mixing events defined within the method.

**SpinSystem**

- Add a new function ``simplify()`` to the spin system object, which reduces a spin system to
a list of irreducible spin systems.
- Add a new function ``site_generator()`` to the utility collection sub-module, which simplify
the process of creating Site objects in bulk.

Changes
'''''''

Expand Down
5 changes: 1 addition & 4 deletions docs/api_py/method.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
Method
======

Method is the root user-level object that may be used in creating custom NMR simulation
methods.

.. toctree::

method/method
method/spectral_dimension
method/event
method/freq_contrib
method/query
method/transition_query
4 changes: 0 additions & 4 deletions docs/api_py/method/event.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ Events
:show-inheritance:
:members:
:inherited-members: BaseModel

.. autoclass:: MixingEvent
:show-inheritance:
:members:
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. _transition_query_api:

.. currentmodule:: mrsimulator.method.query

Expand Down
5 changes: 0 additions & 5 deletions docs/api_py/methods-summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ Summary

.. ~Cosy

UML Diagram
-----------

.. figure:: ../_static/classes_methods.*


Table of contents
-----------------
Expand Down
1 change: 0 additions & 1 deletion docs/api_py/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Utility functions
.. currentmodule:: mrsimulator.utils.collection

.. autofunction:: single_site_system_generator
.. autofunction:: site_generator


.. currentmodule:: mrsimulator.utils
Expand Down
8 changes: 2 additions & 6 deletions docs/getting_started-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,7 @@ see the list of transition pathways, for example,

>>> from pprint import pprint
>>> pprint(sim.methods[0].get_transition_pathways(system_4)) # 17O
[|-2.5⟩⟨-1.5|, weight=(1+0j),
|-1.5⟩⟨-0.5|, weight=(1+0j),
|-0.5⟩⟨0.5|, weight=(1+0j),
|0.5⟩⟨1.5|, weight=(1+0j),
|1.5⟩⟨2.5|, weight=(1+0j)]
[|-2.5⟩⟨-1.5|, |-1.5⟩⟨-0.5|, |-0.5⟩⟨0.5|, |0.5⟩⟨1.5|, |1.5⟩⟨2.5|]

Notice, there are five transition pathways for the :math:`^{17}\text{O}` site, one
associated with the central-transition, two with the inner-satellites, and two with
Expand All @@ -497,7 +493,7 @@ the outer-satellites. For central transition selective simulation, use the
... )
>>> # the transition pathways
>>> print(sim.methods[0].get_transition_pathways(system_4)) # 17O
[|-0.5⟩⟨0.5|, weight=(1+0j)]
[|-0.5⟩⟨0.5|]

Now, you may simulate the central transition selective spectrum.
:numref:`fig8_using_obj` depicts a central transition selective spectrum.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Package dependencies
- typing-extensions>=3.7
- `matplotlib>=3.3.3 <https://matplotlib.org>`_ for figures and visualization,
- monty>=2.0.4
- `csdmpy>=0.4.1 <https://csdmpy.readthedocs.io/en/stable/>`_
- `csdmpy>=0.4 <https://csdmpy.readthedocs.io/en/stable/>`_
- `pydantic>=1.0 <https://pydantic-docs.helpmanual.io>`_
- monty>=2.0.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
"outputs": [],
"source": [
"method = BlochDecaySpectrum(\n channels=[\"29Si\"],\n magnetic_flux_density=14.1, # in T\n rotor_frequency=1500, # in Hz\n spectral_dimensions=[\n {\n \"count\": 2048,\n \"spectral_width\": 25000, # in Hz\n \"reference_offset\": -10000, # in Hz\n \"label\": r\"$^{29}$Si resonances\",\n }\n ],\n)\n\n# A graphical representation of the method object.\nplt.figure(figsize=(4, 2))\nmethod.plot()\nplt.show()"
"method = BlochDecaySpectrum(\n channels=[\"29Si\"],\n magnetic_flux_density=14.1, # in T\n rotor_frequency=1500, # in Hz\n spectral_dimensions=[\n {\n \"count\": 2048,\n \"spectral_width\": 25000, # in Hz\n \"reference_offset\": -10000, # in Hz\n \"label\": r\"$^{29}$Si resonances\",\n }\n ],\n)"
]
},
{
Expand Down Expand Up @@ -168,7 +168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"outputs": [],
"source": [
"method = BlochDecayCTSpectrum(\n channels=[\"33S\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=14000, # in Hz\n spectral_dimensions=[\n {\n \"count\": 2048,\n \"spectral_width\": 5000, # in Hz\n \"reference_offset\": 22500, # in Hz\n \"label\": r\"$^{33}$S resonances\",\n }\n ],\n)\n\n# A graphical representation of the method object.\nplt.figure(figsize=(4, 3))\nmethod.plot()\nplt.show()"
"method = BlochDecayCTSpectrum(\n channels=[\"33S\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=14000, # in Hz\n spectral_dimensions=[\n {\n \"count\": 2048,\n \"spectral_width\": 5000, # in Hz\n \"reference_offset\": 22500, # in Hz\n \"label\": r\"$^{33}$S resonances\",\n }\n ],\n)"
]
},
{
Expand Down Expand Up @@ -150,7 +150,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"outputs": [],
"source": [
"method = Method1D(\n name=\"Inner Satellite Spectrum\",\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 1e4, # in Hz\n \"reference_offset\": 1e4, # in Hz\n \"events\": [\n {\n \"transition_query\": [\n {\"P\": [-1], \"D\": [2]} # <-- select inner satellite transitions\n ]\n }\n ],\n }\n ],\n)\n\n# A graphical representation of the method object.\nplt.figure(figsize=(5, 3))\nmethod.plot()\nplt.show()"
"method = Method1D(\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 1e4, # in Hz\n \"reference_offset\": 1e4, # in Hz\n \"events\": [\n {\n \"transition_query\": [\n {\"P\": [-1], \"D\": [2]} # <-- select inner satellite transitions\n ]\n }\n ],\n }\n ],\n)"
]
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@
},
"outputs": [],
"source": [
"method2 = Method1D(\n name=\"Satellite Spectrum\",\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 1e4, # in Hz\n \"reference_offset\": 1e4, # in Hz\n \"events\": [\n {\n \"transition_query\": [\n {\"P\": [-1], \"D\": [2]}, # <-- select inter satellite transitions\n {\"P\": [-1], \"D\": [4]}, # <-- select outer satellite transitions\n ]\n }\n ],\n }\n ],\n)\n\n# A graphical representation of the method object.\nplt.figure(figsize=(5, 3))\nmethod2.plot()\nplt.show()"
"method2 = Method1D(\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 1e4, # in Hz\n \"reference_offset\": 1e4, # in Hz\n \"events\": [\n {\n \"transition_query\": [\n {\"P\": [-1], \"D\": [2]}, # <-- select inter satellite transitions\n {\"P\": [-1], \"D\": [4]}, # <-- select outer satellite transitions\n ]\n }\n ],\n }\n ],\n)"
]
},
{
Expand Down Expand Up @@ -179,7 +179,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Selecting the triple-quantum transition\n\nFor single-site spin-5/2 spin system, there are three triple-quantum transition\n\n- $|1/2\\rangle\\rightarrow|-5/2\\rangle$ ($P=-3, D=6$)\n- $|3/2\\rangle\\rightarrow|-3/2\\rangle$ ($P=-3, D=0$)\n- $|5/2\\rangle\\rightarrow|-1/2\\rangle$ ($P=-3, D=-6$)\n\nTo select one or more triple-quantum transitions, assign the respective value of P and\nD to the `transition_query`. Here, we select the symmetric triple-quantum transition.\n\n"
"## Selecting the triple-quantum transition\n\nFor spin-site spin-5/2 spin system, there are three triple-quantum transition\n\n- $|1/2\\rangle\\rightarrow|-5/2\\rangle$ ($P=-3, D=6$)\n- $|3/2\\rangle\\rightarrow|-3/2\\rangle$ ($P=-3, D=0$)\n- $|5/2\\rangle\\rightarrow|-1/2\\rangle$ ($P=-3, D=-6$)\n\nTo select one or more triple-quantum transitions, assign the respective value of P and\nD to the `transition_query`.\n\n"
]
},
{
Expand All @@ -69,7 +69,7 @@
},
"outputs": [],
"source": [
"method = Method1D(\n name=\"Arbitrary Transition Method\",\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 5e3, # in Hz\n \"reference_offset\": 2.5e4, # in Hz\n \"events\": [\n { # symmetric triple quantum transitions\n \"transition_query\": [{\"P\": [-3], \"D\": [0]}]\n }\n ],\n }\n ],\n)\n\n# A graphical representation of the method object.\nplt.figure(figsize=(5, 3))\nmethod.plot()\nplt.show()"
"method = Method1D(\n channels=[\"27Al\"],\n magnetic_flux_density=21.14, # in T\n rotor_frequency=1e9, # in Hz\n spectral_dimensions=[\n {\n \"count\": 1024,\n \"spectral_width\": 5e3, # in Hz\n \"reference_offset\": 2.5e4, # in Hz\n \"events\": [\n { # symmetric triple quantum transitions\n \"transition_query\": [{\"P\": [-3], \"D\": [0]}]\n }\n ],\n }\n ],\n)"
]
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
"outputs": [],
"source": [
"spin_systems = single_site_system_generator(\n isotope=\"29Si\",\n isotropic_chemical_shift=iso,\n shielding_symmetric={\"zeta\": zeta, \"eta\": eta},\n abundance=pdf,\n)"
"spin_systems = single_site_system_generator(\n isotopes=\"29Si\",\n isotropic_chemical_shifts=iso,\n shielding_symmetric={\"zeta\": zeta, \"eta\": eta},\n abundance=pdf,\n)"
]
},
{
Expand Down Expand Up @@ -258,7 +258,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
},
"outputs": [],
"source": [
"spin_systems = single_site_system_generator(\n isotope=\"27Al\",\n isotropic_chemical_shift=iso,\n quadrupolar={\"Cq\": Cq * 1e6, \"eta\": eta}, # Cq in Hz\n abundance=pdf,\n)"
"spin_systems = single_site_system_generator(\n isotopes=\"27Al\",\n isotropic_chemical_shifts=iso,\n quadrupolar={\"Cq\": Cq * 1e6, \"eta\": eta}, # Cq in Hz\n abundance=pdf,\n)"
]
},
{
Expand Down Expand Up @@ -208,7 +208,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
"outputs": [],
"source": [
"systems = single_site_system_generator(\n isotope=\"13C\", shielding_symmetric={\"zeta\": z_dist, \"eta\": e_dist}, abundance=amp\n)"
"systems = single_site_system_generator(\n isotopes=\"13C\", shielding_symmetric={\"zeta\": z_dist, \"eta\": e_dist}, abundance=amp\n)"
]
},
{
Expand Down Expand Up @@ -159,7 +159,7 @@
},
"outputs": [],
"source": [
"systems = single_site_system_generator(\n isotope=\"71Ga\", quadrupolar={\"Cq\": cq_dist * 1e6, \"eta\": e_dist}, abundance=amp\n)"
"systems = single_site_system_generator(\n isotopes=\"71Ga\", quadrupolar={\"Cq\": cq_dist * 1e6, \"eta\": e_dist}, abundance=amp\n)"
]
},
{
Expand Down Expand Up @@ -215,7 +215,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
Loading