Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created flimesolve.py #2140

Closed
wants to merge 27 commits into from
Closed

Conversation

magnamancer
Copy link

@magnamancer magnamancer commented Mar 28, 2023

Description
Added a new open system solver based on Floquet theory

hodgestar and others added 15 commits February 7, 2023 16:44
Reconstructed FLiMESolve and FLiMESolver to play more nicely with other QuTiP functions. Wrote FLiMESolver into the correlation tab, but had to add taulist as an input into the _make_solver function.
Trying to rework the time list stuff in FlimeSolve/er to work better with QuTiP. Namely, autogeneration of the time list to create the rate matrix & trying to avoid time list in solver.run so I don't have to do anything kludgey to get the modes in an expedient way
Rewrote the mode table in solver.run() to be found in a slightly slower, but much more generalized fashion
Figured out how to do Expectation operators with my construction of the solvers, and I added a constraint the to the available frequencies in the relaxed secular approx. based on the Nyquist theorem.
Added flimesolve to dynamics-floquet documentation, and added floquet_ex4 as an example usage (identical to floquet_ex3 with exception of use of  flimesolve instead of fmmesolve)

Added towncrier changelog...I think
@magnamancer magnamancer marked this pull request as ready for review June 26, 2023 16:14
Got rid of a few commented lines that were not useful
Deleted folder of scripts I'm using to write a paper about this solver
Copy link
Member

@Ericgig Ericgig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is strange in floquet.py, did you include change not meant to be here?
Both floquet.py and flimesolve.py have the original fmesolve and the new flimesolve...

Tests should pass.
Right now, scipy 1.11 breaks cvxpy which we use so this breaks a few tests, but the changes you made to correlation.py also break the tests.
We will want tests for the new solver.

Could you also review the style (pep8).

  • There are some very long line, we use the official 80 characters width.
  • space are not uniform, sometime they are doubled, other time missing.
  • There are rules for empty lines, there should not be 3 empty lines in a function.

@magnamancer
Copy link
Author

magnamancer commented Jun 27, 2023 via email

I fixed linting, extra spacing, and blank line issues. Moved all new functions to flimesolve.py. Replaced scipy functions with Numpy equivalents. Fixed issues in correlation.py by updating to my most current version, which should just introduce flimesolve.py as an additional solver.
Commented out a [0] in line 91 for some reason. I uncommented it now to bring it better in line with correlation.py
@magnamancer magnamancer requested a review from Ericgig June 27, 2023 19:22
Copy link
Member

@Ericgig Ericgig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a first look.
I see a lot of small style issues, I would suggest that you try a formatting tool: pycodestyle, flake8, black, etc.
I will go into detail on flimesove.py later, but would you mind if I did a pull request agins your local branch to make the tensor using qutip's types. We want to force the use of numpy to the minimum so it can work with other backend, (jax, cupy, tensorflow, etc.).

qutip/solver/correlation.py Outdated Show resolved Hide resolved
doc/guide/scripts/floquet_ex3.py Outdated Show resolved Hide resolved
doc/guide/dynamics/dynamics-floquet.rst Outdated Show resolved Hide resolved
doc/guide/dynamics/dynamics-floquet.rst Outdated Show resolved Hide resolved
qutip/solver/floquet.py Show resolved Hide resolved
qutip/solver/correlation.py Outdated Show resolved Hide resolved
doc/guide/scripts/floquet_ex4.py Outdated Show resolved Hide resolved
doc/guide/scripts/floquet_ex4.py Outdated Show resolved Hide resolved
@Ericgig Ericgig changed the base branch from qutip-5.0.X to master June 27, 2023 21:07
@Ericgig
Copy link
Member

Ericgig commented Jun 27, 2023

I changed the merge target from qutip-5.0.X to master. The qutip-... branches are for released version.
Could you merge the current master branch, we added fixes for the new numpy, scipy version and it should help tests to passes.

magnamancer and others added 2 commits June 27, 2023 18:55
Co-authored-by: Eric Giguère <eric.giguere@calculquebec.ca>
Co-authored-by: Eric Giguère <eric.giguere@calculquebec.ca>
magnamancer and others added 2 commits June 27, 2023 18:55
Co-authored-by: Eric Giguère <eric.giguere@calculquebec.ca>
Co-authored-by: Eric Giguère <eric.giguere@calculquebec.ca>
@magnamancer
Copy link
Author

Used the auto-format feature for PEP8 in my IDE (Spyder), then did a second check with pycodestyle and fixed all the issues it raised. Fixed the other issues you raised as well.

Used built-in autoformat in Spyder and then pycodestyle afterwards to fix code format to PEP8 guidelines.
@magnamancer
Copy link
Author

Merged

I changed the merge target from qutip-5.0.X to master. The qutip-... branches are for released version. Could you merge the current master branch, we added fixes for the new numpy, scipy version and it should help tests to passes.

Merged my qutip-5.0.X to master

@magnamancer
Copy link
Author

I took a first look. I see a lot of small style issues, I would suggest that you try a formatting tool: pycodestyle, flake8, black, etc. I will go into detail on flimesove.py later, but would you mind if I did a pull request agins your local branch to make the tensor using qutip's types. We want to force the use of numpy to the minimum so it can work with other backend, (jax, cupy, tensorflow, etc.).

Please feel free to do a pull request. Alternatively, I can spend some time trying to figure it out myself. Not trying to add anything onto your workload.

@magnamancer magnamancer mentioned this pull request Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants