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

Type-stable bloch_redfield_tensor #262

Merged
merged 3 commits into from
Nov 26, 2019
Merged

Type-stable bloch_redfield_tensor #262

merged 3 commits into from
Nov 26, 2019

Conversation

sd109
Copy link
Contributor

@sd109 sd109 commented Nov 26, 2019

Added a couple of type annotations to the bloch_redfield tensor function and also forced Lindblad part of the tensor to be a sparse operator as this was causing the return value to lack type-stablity.

This leads to a noticeable improvement in time and memory allocations used for this function, especially for larger systems and cases with use_secular=false. Happy to provide example code to demonstrate speed-up if required.

@coveralls
Copy link

coveralls commented Nov 26, 2019

Coverage Status

Coverage decreased (-0.09%) to 98.322% when pulling eeb21ef on sd109:master into a3b24fa on qojulia:master.

@codecov
Copy link

codecov bot commented Nov 26, 2019

Codecov Report

Merging #262 into master will decrease coverage by 0.09%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #262     +/-   ##
=========================================
- Coverage   98.41%   98.32%   -0.1%     
=========================================
  Files          16       16             
  Lines        1071     1073      +2     
=========================================
+ Hits         1054     1055      +1     
- Misses         17       18      +1
Impacted Files Coverage Δ
src/bloch_redfield_master.jl 92.7% <80%> (-0.91%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3b24fa...eeb21ef. Read the comment docs.

@david-pl
Copy link
Member

Looks good to me, thanks! The test failure was unrelated. I added a quick-fix for it. Will merge as soon as tests pass.

@david-pl david-pl merged commit 194bff1 into qojulia:master Nov 26, 2019
karolpezet added a commit to karolpezet/QuantumOptics.jl that referenced this pull request Feb 12, 2020
* fix ishermitian for dense and sparse operator

* Fix manybody deprecated syntax

* Change steady state sorting (qojulia#231)

* Sort by absolute value of real part

* Move normalization and sort by absolute value

* Update checking and error message

* Fix steady eig docstring formatting

* Bump REQUIRE to v0.7-beta2 (qojulia#230)

* Bump REQUIRE to v0.7-beta2

* Fix deprecations

* Fix deprecations

* Remove Compat imports

* Change WignerSymbols version

* First successful build

* Fock tests pass

* Some more tests pass

* All tests except printing pass

* Replace Complex128 with ComplexF64 in tests

* Rename Complex128 to ComplexF64

* Add FFTW requirement

* Update printing

* Add Arpack requirement

* Add rounding to printing

* Update tests to use 0.7

* Fix compilation deprecation warnings

* Fix printing

* Fix deprecations

* Rename full to dense

* Fix some more deprecations

* More deprecations

* Fix operator deprecations

* Fix particle deprecations

* Fix all deprecations occurring in tests

* Update REQUIRE

* Update appveyor

* Fix a bug in subspace; export norm

* Fix silly bug in subspace

* v0.7 compatibility

* Implement macros to skip checks

commit f221430
Author: david-pl <[email protected]>
Date:   Fri Aug 17 11:16:22 2018 +0200

    Update macro docstrings

commit 62f10e8
Author: David Plankensteiner <[email protected]>
Date:   Tue Aug 14 21:17:58 2018 +0200

    Fix stochastic checks

commit 5c9eff5
Author: David Plankensteiner <[email protected]>
Date:   Tue Aug 14 20:45:51 2018 +0200

    Rename macros

commit f78cf33
Author: david-pl <[email protected]>
Date:   Tue Aug 14 16:01:36 2018 +0200

    Start renaming stuff

commit c5f8bd6
Author: David Plankensteiner <[email protected]>
Date:   Mon Aug 13 20:25:58 2018 +0200

    Implement macros to skip checks

* Define ' on Operator as dagger (qojulia#235)

* fix typo

* Enable v1.0 testing

* Implement parametric types (qojulia#238)

* Start parametric typing for Ket/Bra

* Fix tensor vararg for StateVector

* Fix subspacebasis field parameters

* Fix semiclassical state for kets

* Update testing scripts

* Fix typo in appveyor

* Fix semiclassical_stochastic ket typing

* Fix travis 1.0 testing

* Parametric typing for CompositeBasis

* Rename Operator to AbstractOperator

* Proper parametric type for CompositeBasis

* Parametric typing for operators

* Parametrize basis dimensions

* Revert "Parametrize basis dimensions"

This reverts commit b451987.

* Update basis checks for states

* Update basis checks for dense operators

* Update basis checks for sparse operators

* Update LazyProduct implementation

* Update LazySum implementation

* Update LazyTensor implementation

* Add non-type parameters where needed to ensure correct basis dispatch

* Update basis checks for schroedinger

* Update basis checks for metrics

* Update basis checks for phasespace

* Update basis checks for master

* Update basis checks for mcwf

* Update basis checks for semiclassical

* Update superoperators and steadystate

* Update basis checks for stochastic solvers

* Update timecorrelations basis checks

* Added parameter to FFToperators so the gemv! is type stable

* Add basis checks to FFT in-place multiplication

* Implement transpose forsparse/dense operators

* Proper recasting in mcwf

* Add some missing basis checks

* Fix silly copy-paste error

* Less strict typing for liouvillian

* Mention gitter in readme text

* Some dots for states and operators
Squashed commit of the following:

commit abc523b
Author: david-pl <[email protected]>
Date:   Fri Jan 11 10:28:33 2019 +0100

    Broadcasting for states, operators and superoperators

commit 838f717
Author: David Plankensteiner <[email protected]>
Date:   Sat Dec 8 12:59:47 2018 +0100

    Use custom broadcasting styles

commit bedef6e
Author: David Plankensteiner <[email protected]>
Date:   Fri Dec 7 11:49:40 2018 +0100

    Broadcasting for sparse and dense operators

* Fix typo in macro export

* Fix @warn and implement adjoint(StateVector)

* Update tests to newer Julia versions

* Fix documentation of gaussianstate

* Patch failing tests

* created coherentstate! for inplace operations

* Fix bug in MCWF display_afterevent

* before embedding check that the destination basis matches the operator basis (qojulia#246)

* before embedding check that the destination basis matches the operator basis

* Change embed to handle composite operators

* perform embedding of an operator in a joint hilbert space

* functional embedding with new syntax

* more tests for composite bases

* code review and a few more tests

* Change Int64 to Int in type checks for x86

* remove intersect and union from sortedindices, as there are appropriate methods in Base

* Fix default choice of noise for stochastics

* Add Bloch-Redfield master equation (qojulia#250)

* Added bloch_redfield_master submodule

Added the option for a Bloch-Redfield master equation in the timeevolution module

* Add files via upload

* Delete bloch_redfield_master.jl

* Delete QuantumOptics.jl

* Update bloch_redfield_master.jl

* Cleaned up and commented new bloch_redfield_master submodule

* Delete bloch_redfield_master.jl

* Moved bloch_redfield_master to correct location...

* Re-added coherentstate! (inplace)

* Add simple test

* Include new test file

* Replace vec2mat_index by CartesianIndices

* Use timeevolution_base for BR master

* Added docstrings and renamed c_ops kwarg to J

Changed c_ops kwarg in bloch_redfield_tensor to J to be consistent with Linblad ME implementation

* Fix a bug and better saving

* Type-stable fout

* Fixed docstring typos in bloch_redfield_master

* Update README.md

* Switch to Project.toml

* Update Project.toml

* Abstractions for quantum information on qubits (qojulia#251)

* created abstractions for quantum information on qubits

* changed how equality is handled and added tests

* code review

* cleanup on types and added tests

* code review and composition for chi and ptm

* better caching

* code review for isapprox vs ==

* Move windows tests to travis

* Improve in-place multiplication for lazy types

* Patch bug in mcwf_dynamic

* Make entropy_vn type-stable

* Update Project.toml

* Restrict broadcasting of functions on states and operators

* Make bases immutable

* use ARPACKException from Arpack.jl

* Semiclassical MCWF (qojulia#255)

* MCWF jump times and indices (qojulia#257)

* semicl mcwf

* semicl mcwf läuft

* semiclassical mcfw

* Change MCWF interface to display jumps

* Semiclassical mcwf with display event

* Add display_which and display_t to semiclassical mcwf

* Clean up integrate_mcwf

* Clean up semiclassical mcwf

* Add docstrings

* Add docstrings in semiclassical.mcwf

* Fix tests

* Update Project.toml

* Remove QuantumOpticsBase functionality (qojulia#259)

* Remove QuantumOpticsBase functionality

* Re-add changes to mcwf interface lost during deletion

* Update semiclassical mcwf docstrings

* Fix precompilation

* Add superoperator tests that cannot run in Base

* Re-add spectralanalysis

* Separate stochastic base functionality from timeevolution

* Update Project.toml

* Type-stable bloch_redfield_tensor (qojulia#262)

* Made bloch_redfield_tensor function type-stable

* Quick patch failing tests

* Install TagBot as a GitHub Action

* Update Project.toml

Co-authored-by: goropikari <[email protected]>
Co-authored-by: David Plankensteiner <[email protected]>
Co-authored-by: David Nadlinger <[email protected]>
Co-authored-by: Louis Ponet <[email protected]>
Co-authored-by: wolfgang-n <[email protected]>
Co-authored-by: alexander papageorge <[email protected]>
Co-authored-by: sd109 <[email protected]>
Co-authored-by: Kristoffer Carlsson <[email protected]>
Co-authored-by: Julia TagBot <[email protected]>
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.

3 participants