Skip to content

Commit 489cff7

Browse files
Fix the issue with assigning kernels to ops before registering kernels on macOS (#582)
* Fix the issue with assigning kernels to ops before registering kernels on macOS * Auto update version * Update changelog * Remove unnecessary code comments --------- Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
1 parent 8101e42 commit 489cff7

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.github/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
* Fix MPI Python unit tests for the adjoint method.
8383
[(#538)](https://github.com/PennyLaneAI/pennylane-lightning/pull/538)
8484

85+
* Fix the issue with assigning kernels to ops before registering kernels on macOS
86+
[(#582)](https://github.com/PennyLaneAI/pennylane-lightning/pull/582)
87+
8588
### Contributors
8689

8790
This release contains contributions from (in alphabetical order):

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.34.0-dev20"
19+
__version__ = "0.34.0-dev21"

pennylane_lightning/core/src/simulators/lightning_qubit/gates/DynamicDispatcher.hpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,8 @@ template <typename PrecisionT> class DynamicDispatcher {
105105

106106
private:
107107
std::unordered_map<std::string, GateOperation> str_to_gates_{};
108-
std::unordered_map<std::string, ControlledGateOperation>
109-
str_to_controlled_gates_{};
108+
110109
std::unordered_map<std::string, GeneratorOperation> str_to_gntrs_{};
111-
std::unordered_map<std::string, ControlledGeneratorOperation>
112-
str_to_controlled_gntrs_{};
113110

114111
std::unordered_map<std::pair<GateOperation, KernelType>, GateFunc, PairHash>
115112
gate_kernels_{};
@@ -122,6 +119,14 @@ template <typename PrecisionT> class DynamicDispatcher {
122119
PairHash>
123120
matrix_kernels_{};
124121

122+
std::unordered_map<KernelType, std::string> kernel_names_{};
123+
124+
std::unordered_map<std::string, ControlledGateOperation>
125+
str_to_controlled_gates_{};
126+
127+
std::unordered_map<std::string, ControlledGeneratorOperation>
128+
str_to_controlled_gntrs_{};
129+
125130
std::unordered_map<std::pair<ControlledGateOperation, KernelType>,
126131
ControlledGateFunc, PairHash>
127132
controlled_gate_kernels_{};
@@ -134,8 +139,6 @@ template <typename PrecisionT> class DynamicDispatcher {
134139
ControlledMatrixFunc, PairHash>
135140
controlled_matrix_kernels_{};
136141

137-
std::unordered_map<KernelType, std::string> kernel_names_{};
138-
139142
DynamicDispatcher() {
140143
constexpr static auto gntr_names_without_prefix =
141144
Internal::generatorNamesWithoutPrefix();

0 commit comments

Comments
 (0)