Skip to content

Commit c5fc17c

Browse files
amilstedAshley Milsted
andauthored
Faster LazyTensor mul!() for dense suboperators (#39)
Dramatically speed up operations involving LazyTensors consisting of dense factors. * Use transpose-GEMM-transpose approach for LazyTensor operations so that BLAS can be used. * Add limited support for summing LazyTensor operators. * Keep old code as special case for pure sparse LazyTensors (it is faster for this case) Co-authored-by: Ashley Milsted <[email protected]>
1 parent 91ac4fd commit c5fc17c

File tree

4 files changed

+480
-51
lines changed

4 files changed

+480
-51
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name = "QuantumOpticsBase"
22
uuid = "4f57444f-1401-5e15-980d-4471b28d5678"
3-
version = "v0.3.1"
3+
version = "0.3.1"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
77
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
8+
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1011
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
12+
Strided = "5e0ebb24-38b0-5f93-81fe-25c709ecae67"
1113

1214
[compat]
1315
Adapt = "1, 2, 3.3"

src/QuantumOpticsBase.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module QuantumOpticsBase
22

3-
using SparseArrays, LinearAlgebra
3+
using SparseArrays, LinearAlgebra, LRUCache, Strided
44
import LinearAlgebra: mul!, rmul!
55

66
export bases, Basis, GenericBasis, CompositeBasis, basis,
@@ -13,7 +13,8 @@ export bases, Basis, GenericBasis, CompositeBasis, basis,
1313
operators_sparse, SparseOperator, diagonaloperator, SparseOpType,
1414
operators_lazysum, LazySum,
1515
operators_lazyproduct, LazyProduct,
16-
operators_lazytensor, LazyTensor,
16+
operators_lazytensor, LazyTensor, lazytensor_use_cache, lazytensor_clear_cache,
17+
lazytensor_cachesize, lazytensor_disable_cache, lazytensor_enable_cache,
1718
superoperators, SuperOperator, DenseSuperOperator, DenseSuperOpType,
1819
SparseSuperOperator, SparseSuperOpType, spre, spost, liouvillian,
1920
fock, FockBasis, number, destroy, create,

0 commit comments

Comments
 (0)