@@ -83,7 +83,7 @@ evolve(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
83
83
std::initializer_list<ObserveOpTy> observables = {},
84
84
bool store_intermediate_results = false ,
85
85
std::optional<int > shots_count = std::nullopt) {
86
- #if defined(CUDAQ_DYNAMICS_TARGET )
86
+ #if defined(CUDAQ_ANALOG_TARGET )
87
87
return cudaq::__internal__::evolveSingle (
88
88
cudaq::__internal__::convertOp (hamiltonian), dimensions, schedule,
89
89
initial_state, integrator,
@@ -113,7 +113,7 @@ evolve_result evolve(const HamTy &hamiltonian,
113
113
const std::vector<ObserveOpTy> &observables = {},
114
114
bool store_intermediate_results = false ,
115
115
std::optional<int > shots_count = std::nullopt) {
116
- #if defined(CUDAQ_DYNAMICS_TARGET )
116
+ #if defined(CUDAQ_ANALOG_TARGET )
117
117
return cudaq::__internal__::evolveSingle (
118
118
cudaq::__internal__::convertOp (hamiltonian), dimensions, schedule,
119
119
initial_state, integrator,
@@ -147,7 +147,7 @@ evolve(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
147
147
std::initializer_list<ObserveOpTy> observables = {},
148
148
bool store_intermediate_results = false ,
149
149
std::optional<int > shots_count = std::nullopt) {
150
- #if defined(CUDAQ_DYNAMICS_TARGET )
150
+ #if defined(CUDAQ_ANALOG_TARGET )
151
151
std::vector<evolve_result> results;
152
152
for (const auto &initial_state : initial_states)
153
153
results.emplace_back (evolve (hamiltonian, dimensions, schedule,
@@ -183,13 +183,13 @@ evolve(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
183
183
const std::vector<ObserveOpTy> &observables = {},
184
184
bool store_intermediate_results = false ,
185
185
std::optional<int > shots_count = std::nullopt) {
186
- #if defined(CUDAQ_DYNAMICS_TARGET )
186
+ #if defined(CUDAQ_ANALOG_TARGET )
187
187
std::vector<evolve_result> results;
188
188
for (const auto &initial_state : initial_states)
189
- results.emplace_back (evolve (hamiltonian, dimensions, schedule,
190
- initial_state, integrator, collapse_operators ,
191
- observables, store_intermediate_results ,
192
- shots_count));
189
+ results.emplace_back (evolve (
190
+ hamiltonian, dimensions, schedule, initial_states, integrator ,
191
+ collapse_operators, initial_state, integrator, collapse_operators ,
192
+ observables, store_intermediate_results, shots_count));
193
193
return results;
194
194
#else
195
195
static_assert (
@@ -219,7 +219,7 @@ evolve_async(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
219
219
std::initializer_list<ObserveOpTy> observables = {},
220
220
bool store_intermediate_results = false ,
221
221
std::optional<int > shots_count = std::nullopt, int qpu_id = 0 ) {
222
- #if defined(CUDAQ_DYNAMICS_TARGET )
222
+ #if defined(CUDAQ_ANALOG_TARGET )
223
223
// Clone the integrator to extend its lifetime.
224
224
auto cloneIntegrator = integrator.clone ();
225
225
auto collapseOperators = cudaq::__internal__::convertOps (collapse_operators);
@@ -259,7 +259,7 @@ evolve_async(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
259
259
const std::vector<ObserveOpTy> &observables = {},
260
260
bool store_intermediate_results = false ,
261
261
std::optional<int > shots_count = std::nullopt, int qpu_id = 0 ) {
262
- #if defined(CUDAQ_DYNAMICS_TARGET )
262
+ #if defined(CUDAQ_ANALOG_TARGET )
263
263
// Clone the integrator to extend its lifetime.
264
264
auto cloneIntegrator = integrator.clone ();
265
265
return __internal__::evolve_async (
@@ -277,4 +277,25 @@ evolve_async(const HamTy &hamiltonian, const cudaq::dimension_map &dimensions,
277
277
" recompile your application with '--target dynamics' flag." );
278
278
#endif
279
279
}
280
- } // namespace cudaq
280
+
281
+ // Rydberg Hamiltonian
282
+ evolve_result evolve (const cudaq::rydberg_hamiltonian &hamiltonian,
283
+ const cudaq::schedule &schedule,
284
+ std::optional<int > shots_count = std::nullopt) {
285
+ return cudaq::__internal__::evolveSingle (hamiltonian, schedule, shots_count);
286
+ }
287
+
288
+ async_evolve_result evolve_async (const cudaq::rydberg_hamiltonian &hamiltonian,
289
+ const cudaq::schedule &schedule,
290
+ std::optional<int > shots_count = std::nullopt,
291
+ int qpu_id = 0 ) {
292
+ return cudaq::__internal__::evolve_async (
293
+ [=]() {
294
+ ExecutionContext context (" evolve" );
295
+ cudaq::get_platform ().set_exec_ctx (&context, qpu_id);
296
+ return evolve (hamiltonian, schedule, shots_count);
297
+ },
298
+ qpu_id);
299
+ }
300
+
301
+ } // namespace cudaq
0 commit comments