Skip to content

Commit 96a1961

Browse files
committed
MCQT Solver and Two-mode Wigner
1 parent cf8678a commit 96a1961

File tree

21 files changed

+907
-99
lines changed

21 files changed

+907
-99
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## v1.0.1 - 2023/10/04 - 00 - MCQT Solver and Two-mode Wigner
4+
* Minor fixes to `qom.solvers.deterministic` module.
5+
* Updated `qom.solvers.measure` module:
6+
* Added support for two-mode Wigner distribution.
7+
* Minor fixes to single-mode Wigner distribution.
8+
* Added `qom.solvers.deterministic` module with the `MCQTSolver` class for Monte-Carlo quantum trajectories.
9+
* Updated `qom.ui.plotters` package:
10+
* Added support for legend range selection in `base` module.
11+
* Added option to import legend from Y-axis data in `matplotlib` module.
12+
* Added option for z-order of scatter plots in `matplotlib` module.
13+
* Added parallelization support for Monte-Carlo quantum trajectories solver in `qom.utils.solvers` module.
14+
* Added `qom.misc` module for operators and state vectors.
15+
* Minor fixes to `qom.io` module.
16+
* Updated logging for all modules.
17+
* Updated documentation.
18+
* Updated `README`.
19+
320
## v1.0.0 - 2023/07/20 - 00 - Updated README
421
* Updated `docs/source/index`.
522
* Removed `pyproject.toml`.

CITATION.bib

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
@inproceedings{ICICT.2023.315
2-
title = {The QOM Toolbox: An object-oriented Python framework for cavity optomechanical systems},
2+
title = {The QOM Toolbox: An Object-oriented Python Framework for Cavity Optomechanical Systems},
33
author = {Kalita, Sampreet and Sarma, Amarendra K.},
44
booktitle = {Proceedings of Eighth International Congress on Information and Communication Technology},
5-
year = {2023},
6-
volume = {3},
7-
number = {1},
5+
editor = {Yang, Xin-She and Sherratt, R. Simon and Dey, Nilanjan and Joshi, Amit},
86
series = {Lecture Notes in Networks and Systems},
9-
publisher = {Springer Singapore},
10-
url = {https://link.springer.com/book/9789819930449}
7+
year = {2023},
8+
month = {July},
9+
volume = {694},
10+
pages = {581--590},
11+
publisher = {Springer Nature Singapore},
12+
doi = {10.1007/978-981-99-3091-3_48},
13+
isbn = {978-981-99-3091-3},
14+
url = {https://link.springer.com/chapter/10.1007/978-981-99-3091-3_48}
1115
}

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# The Quantum Optomechanics Toolbox
22

3-
![Latest Version](https://img.shields.io/badge/version-1.0.0-red?style=for-the-badge)
3+
![Latest Version](https://img.shields.io/badge/version-1.0.1-red?style=for-the-badge)
44
[![Last Commit](https://img.shields.io/github/last-commit/sampreet/qom?style=for-the-badge)](https://github.com/sampreet/qom/blob/master/CHANGELOG.md)
55

6-
[![Last Release](https://img.shields.io/github/release-date/sampreet/qom?style=flat-square&label=Last%20Release)](https://github.com/sampreet/qom/releases/tag/v0.9.0)
6+
[![Last Release](https://img.shields.io/github/release-date/sampreet/qom?style=flat-square&label=Last%20Release)](https://github.com/sampreet/qom/releases/tag/v1.0.1)
77
[![Open Issues](https://img.shields.io/github/issues-raw/sampreet/qom?style=flat-square)](https://github.com/sampreet/qom/issues?q=is%3Aopen+is%3Aissue)
88
[![Closed Issues](https://img.shields.io/github/issues-closed-raw/sampreet/qom?style=flat-square)](https://github.com/sampreet/qom/issues?q=is%3Aissue+is%3Aclosed)
99

@@ -29,12 +29,12 @@ Backed by numerical libraries like NumPy and SciPy, and featuring the highly cus
2929
| ![Stability](./docs/images/00_00_sz.png) | ![Correlations](./docs/images/00_01_en.png) |
3030
| Runtimes for the calculation of dynamical stability of the steady state using the Routh-Hurwitz criteria. | Runtimes for the calculation of average entanglement from the dynamical values of modes and correlations. |
3131

32-
### Up Next!
32+
* Faster Monte-Carlo quantum trajectories solver for low-dimensional Hilbert spaces.
3333

3434
| Monte-Carlo Quantum Trajectories |
3535
|---|
3636
| ![Stability](./docs/images/00_02_mcqt.png) |
37-
| Comparison of runtimes for the Jaynes-Cummings Hamiltonian. |
37+
| Comparison of runtimes for the Jaynes-Cummings Hamiltonian with Hilbert space dimension of 10. |
3838

3939
## Examples
4040

@@ -63,7 +63,7 @@ Backed by numerical libraries like NumPy and SciPy, and featuring the highly cus
6363
| ![Wigner](./docs/images/05_00_wigner.gif) | ![Soliton](./docs/images/05_01_soliton.gif) |
6464
| Wigner distribution depicting the evolution of mechanical squeezing in a modulated optomechanical system. | Soliton propagation in an array of optomechanical systems at different phase lags between the input solitons. |
6565

66-
A set of notebooks and scripts to demonstrate the usage of the toolbox can be found [here](https://github.com/sampreet/qom-examples).
66+
A set of notebooks and scripts to demonstrate the usage of the toolbox can be found in the [examples repository](https://github.com/sampreet/qom-examples).
6767

6868
## Installation
6969

@@ -86,7 +86,9 @@ conda install matplotlib numpy scipy sympy seaborn
8686

8787
***Note: To run the GUI modules, `pyqt` should be installed separately.***
8888

89-
Once the dependencies are installed, the toolbox can be installed via PyPI (last release: v0.9.0) or locally (latest version: v1.0.0).
89+
Once the dependencies are installed, the toolbox can be installed via PyPI or locally.
90+
91+
The documentation of the latest release is available [here](https://sampreet.github.io/qom-docs).
9092

9193
### Installing via PyPI
9294

@@ -96,19 +98,15 @@ To install the last release via the Python Package Index, execute:
9698
pip install -i https://test.pypi.org/simple/ qom
9799
```
98100

99-
The corresponding documentation is available [here](https://sampreet.github.io/qom-docs/v0.9.0).
100-
101101
### Installing Locally
102102

103103
To install the latest version locally, download the repository as `.zip` and extract the contents.
104-
Now, execute the following from *outside* the top-level directory, `ROOT_DIR`, inside which `setup.py` is located (refer to the file structure [here](./CONTRIBUTING.md)):
104+
Now, execute the following from *outside* the top-level directory, `ROOT_DIR`, inside which `setup.py` is located (refer to the [file structure](./CONTRIBUTING.md)):
105105

106106
```bash
107107
pip install -e ROOT_DIR
108108
```
109109

110-
The corresponding documentation is available [here](https://sampreet.github.io/qom-docs).
111-
112110
## Basic Usage
113111

114112
The library features easy-to-use functions to calculate as well as visualize the trend of several quantum signatures.
@@ -222,4 +220,4 @@ Also, make sure you adhere to the [code of conduct](./CODE_OF_CONDUCT.md).
222220

223221
## Citing
224222

225-
Please cite [S. Kalita and A. K. Sarma, *The QOM Toolbox: An object-oriented Python framework for cavity optomechanical systems*, Proceedings of Eighth International Congress on Information and Communication Technology **3**, Springer Singapore (2023)](./CITATION.bib) if you use our work in your research.
223+
Please cite [S. Kalita and A. K. Sarma, *The QOM Toolbox: An Object-oriented Python Framework for Cavity Optomechanical Systems*, Proceedings of Eighth International Congress on Information and Communication Technology, Lecture Notes in Networks and Systems, Volume 694, 581-590, Springer Nature Singapore (2023)](./CITATION.bib) if you use our work in your research.

docs/images/00_02_mcqt.png

-35 Bytes
Loading

docs/source/index.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. Quantum Optomechanics Toolbox documentation master file, created by
22
sphinx-quickstart on Fri Dec 4 15:06:12 2020.
33
4-
Welcome to the ``qom-v1.0.0`` Documentation!
4+
Welcome to the ``qom-v1.0.1`` Documentation!
55
============================================
66

77
The Quantum Optomechanics Toolbox (packaged as ``qom``) is a wrapper-styled, scalable toolbox featuring multiple modules for the calculation of stationary as well as dynamical properties of many-body quantum optomechanical systems.
@@ -32,16 +32,15 @@ What's New in v1.0!
3232
* - Runtimes for the calculation of dynamical stability of the steady state using the Routh-Hurwitz criteria.
3333
- Runtimes for the calculation of average entanglement from the dynamical values of modes and correlations.
3434

35-
Up Next!
36-
--------
35+
* Faster Monte-Carlo quantum trajectories solver for low-dimensional Hilbert spaces.
3736

3837
.. list-table::
3938
:widths: 100
4039
:header-rows: 1
4140

4241
* - Monte-Carlo Quantum Trajectories
4342
* - .. image:: ../images/00_02_mcqt.png
44-
* - Comparison of runtimes for the Jaynes-Cummings Hamiltonian.
43+
* - Comparison of runtimes for the Jaynes-Cummings Hamiltonian with Hilbert space dimension of 10.
4544

4645
Examples
4746
--------
@@ -101,7 +100,7 @@ Examples
101100
* - Wigner distribution depicting the evolution of mechanical squeezing in a modulated optomechanical system.
102101
- Soliton propagation in an array of optomechanical systems at different phase lags between the input solitons.
103102

104-
A set of notebooks and scripts to demonstrate the usage of the toolbox can be found `here <https://github.com/sampreet/qom-examples>`_.
103+
A set of notebooks and scripts to demonstrate the usage of the toolbox can be found in the `examples repository <https://github.com/sampreet/qom-examples>`_.
105104

106105
Installation
107106
============
@@ -126,7 +125,9 @@ These libraries can be installed using:
126125
127126
.. note:: To run the GUI modules, ``pyqt`` should be installed separately.
128127

129-
Once the dependencies are installed, the toolbox can be installed via PyPI (last release: v0.9.0) or locally (latest version: v1.0.0).
128+
Once the dependencies are installed, the toolbox can be installed via PyPI or locally.
129+
130+
The documentation of the latest release is available `here <https://sampreet.github.io/qom-docs>`_.
130131

131132
Installing via PyPI
132133
-------------------
@@ -137,20 +138,16 @@ To install the packages via the Python Package Index (PyPI), execute:
137138
138139
pip install -i https://test.pypi.org/simple/ qom
139140
140-
The corresponding documentation is available `here <https://sampreet.github.io/qom-docs/v0.9.0>`_.
141-
142141
Installing Locally
143142
------------------
144143

145144
To install the package locally, download `the repository <https://github.com/sampreet/qom>`_ as ``.zip`` and extract the contents.
146-
Now, execute the following from *outside* the top-level directory, ``ROOT_DIR``, inside which ``setup.py`` is located (refer to the file structure `here <https://github.com/sampreet/qom/blob/master/CONTRIBUTING.md>`_):
145+
Now, execute the following from *outside* the top-level directory, ``ROOT_DIR``, inside which ``setup.py`` is located (refer to the `file structure <https://github.com/sampreet/qom/blob/master/CONTRIBUTING.md>`_):
147146

148147
.. code-block:: bash
149148
150149
pip install -e ROOT_DIR
151150
152-
The corresponding documentation is available `here <https://sampreet.github.io/qom-docs>`_.
153-
154151
Citing
155152
======
156153

docs/source/qom.solvers.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ qom.solvers package
99
qom.solvers.deterministic
1010
qom.solvers.differential
1111
qom.solvers.measure
12-
qom.solvers.stability
12+
qom.solvers.stability
13+
qom.solvers.stochastic
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
qom.solvers.stochastic module
2+
=============================
3+
4+
.. automodule:: qom.solvers.stochastic
5+
:members:
6+
:private-members:
7+
:undoc-members:
8+
:show-inheritance:

qom/io.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
__name__ = 'qom.io'
77
__authors__ = ["Sampreet Kalita"]
88
__created__ = "2023-05-28"
9-
__updated__ = "2023-07-12"
9+
__updated__ = "2023-08-14"
1010

1111
# dependencies
12+
import logging
1213
import numpy as np
1314
import os
1415
import time
@@ -20,8 +21,8 @@ class Updater():
2021
2122
Parameters
2223
----------
23-
logger : :class:`logging.logger`
24-
Module logger.
24+
name : str
25+
Name of the module or class.
2526
cb_update : callable, optional
2627
Callback function to update status and progress, formatted as ``cb_update(status, progress, reset)``, where ``status`` is a string, ``progress`` is a float and ``reset`` is a boolean.
2728
parallel : bool, default=False
@@ -32,11 +33,11 @@ class Updater():
3233
Time at which the process was started. If not provided, the value is initialized to current time.
3334
"""
3435

35-
def __init__(self, logger, cb_update, parallel:bool=False, p_index:int=0, p_start:float=None):
36+
def __init__(self, name, cb_update, parallel:bool=False, p_index:int=0, p_start:float=None):
3637
"""Class constructor for Updater."""
3738

3839
# set constants
39-
self.logger = logger
40+
self.logger = logging.getLogger(name)
4041
self.cb_update = cb_update
4142
self.parallel = parallel
4243
self.p_index = p_index
@@ -99,7 +100,7 @@ def update_progress(self, pos:int, dim:int, status:str, reset:bool):
99100
status = status if status is not None else ""
100101

101102
# current time
102-
_time = time.time()
103+
_time = time.time()
103104

104105
# display progress
105106
_init_or_comp = reset or progress == 100.0

qom/loopers/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
__name__ = 'qom.loopers.base'
77
__authors__ = ["Sampreet Kalita"]
88
__created__ = "2020-12-21"
9-
__updated__ = "2023-07-12"
9+
__updated__ = "2023-10-04"
1010

1111
# dependencies
1212
from decimal import Decimal
1313
from typing import Union
1414
import copy
15-
import logging
1615
import numpy as np
1716
import time
1817

@@ -95,8 +94,6 @@ def __init__(self, func, params:dict, params_system:dict, cb_update, parallel:bo
9594
self.func = func
9695
self.parallel = parallel
9796
self.p_index = p_index
98-
self.time = time.time()
99-
self.p_start = p_start if p_start is not None else self.time
10097

10198
# set parameters
10299
self.set_params(params)
@@ -118,11 +115,11 @@ def __init__(self, func, params:dict, params_system:dict, cb_update, parallel:bo
118115

119116
# set updater
120117
self.updater = Updater(
121-
logger=logging.getLogger('qom.loopers.' + self.name),
118+
name='qom.loopers.' + self.name,
122119
cb_update=cb_update,
123120
parallel=parallel,
124121
p_index=p_index,
125-
p_start=self.p_start
122+
p_start=p_start if p_start is not None else time.time()
126123
)
127124
# display initialization
128125
self.updater.update_info(
@@ -168,7 +165,10 @@ def set_axis(self, axis:str):
168165
_val = _axis.get('val', None)
169166
# convert to numpy array
170167
if type(_val) is list:
171-
_val = np.array(_val, dtype=np.float_)
168+
if type(_val[0]) is int:
169+
_val = np.array(_val, dtype=np.int32)
170+
elif type(_val[0]) is float:
171+
_val = np.array(_val, dtype=np.float_)
172172
# update values
173173
if type(_val) is np.ndarray:
174174
# validate values

0 commit comments

Comments
 (0)