Commit df4609e
authored
Migrate Python dynamics solver implementation to pybind11 (#2853)
* [WIP] Work on migrating dynamics to C++ binding
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Fix sporadic segfault due to the Python callbacks
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Fix a row- and column major mismatches
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Passing RK step size from Python
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Init MPI for C++ cudm
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Init MPI at the context level when the handle is created
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Trim down CuDensityMatState ctor and remove API that may result in state copy
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Perf improvement
- Make sure we do accumulate + scaling in a single cublas call
- Optimize tempory memory allocation with cuda mempool: we allocate
quite a lot of temporary memory during the evolution hence make sure
to use mempool (as cupy does)
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Support creating initial state from enum in C++. The created state is MPI-compatible
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Add performance metric monitor
dynamics solver involves many repetitive steps, hence, conventional
trace logging is not suitable. Adding a metric map, which tracks the
total time across many calls, e.g., to computeAction, to display
aggregated data.
Refactor the allocator into a helper class for better configurability.
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Update examples
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Code format
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Code format
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Code clean up
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Code cleanup
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* add validation
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Fix skbuild
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* proper translation for nsteps and step size for the native integrator
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Further slim down dynamics solver Python surface
- Get rid of the Pythonic CudmState class. Everything now operates on
cudaq::state.
- Unify the kron order.
- Add a cuBlas-based outter product implementation for
to_density_matrix.
- Add more tests.
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Clang-format
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* python yapf format
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Code review: fix the example preface comment
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Fix docs build
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* code format
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Address code review comments/feedback
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
* Address code review: rename output file for example
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
---------
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>1 parent 43c635e commit df4609e
43 files changed
Lines changed: 1486 additions & 1176 deletions
File tree
- docs/sphinx
- api/languages
- examples
- cpp/dynamics
- python/dynamics
- python
- cudaq
- dynamics
- integrators
- runtime/cudaq
- algorithms
- dynamics
- tests/dynamics
- integrators
- runtime
- common
- cudaq/algorithms
- nvqir/cudensitymat
- unittests/dynamics
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
Lines changed: 157 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | | - | |
| 38 | + | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
0 commit comments