diff --git a/runtime/cudaq/evolution.h b/runtime/cudaq/evolution.h index 3b86c448ce..c2915319e2 100644 --- a/runtime/cudaq/evolution.h +++ b/runtime/cudaq/evolution.h @@ -8,10 +8,10 @@ #pragma once +#include "common/EvolveResult.h" +#include "cudaq/base_integrator.h" #include "cudaq/operators.h" #include "cudaq/schedule.h" -#include "cudaq/base_integrator.h" -#include "common/EvolveResult.h" #include #include @@ -22,25 +22,60 @@ namespace cudaq { class Evolution { public: - /// Computes the Taylor series expansion of the matrix exponential. - static Eigen::MatrixXcd taylor_series_expm(const Eigen::MatrixXcd &op_matrix, int order = 20); + /// Computes the Taylor series expansion of the matrix exponential. + static Eigen::MatrixXcd taylor_series_expm(const Eigen::MatrixXcd &op_matrix, + int order = 20); - /// Computes the evolution step matrix - static Eigen::MatrixXcd compute_step_matrix(const operator_sum &hamiltonian, const std::map &dimensions, const std::map> ¶meters, double dt, bool use_gpu = false); + /// Computes the evolution step matrix + static Eigen::MatrixXcd compute_step_matrix( + const operator_sum &hamiltonian, const std::map &dimensions, + const std::map> ¶meters, double dt, + bool use_gpu = false); - /// Adds noise channels based on collapse operators. - static void add_noise_channel_for_step(const std::string &step_kernel_name, cudaq::noise_model &noise_model, const std::vector &collapse_operators, const std::map &dimensions, const std::map> ¶meters, double dt); + /// Adds noise channels based on collapse operators. + static void add_noise_channel_for_step( + const std::string &step_kernel_name, cudaq::noise_model &noise_model, + const std::vector &collapse_operators, + const std::map &dimensions, + const std::map> ¶meters, double dt); - /// Launches an analog Hamiltonian kernel for quantum simulations. - static evolve_result launch_analog_hamiltonian_kernel(const std::string &target_name, const operator_sum &hamiltonian, const std::shared_ptr &schedule, int shots_count, bool is_async = false); + /// Launches an analog Hamiltonian kernel for quantum simulations. + static evolve_result + launch_analog_hamiltonian_kernel(const std::string &target_name, + const operator_sum &hamiltonian, + const std::shared_ptr &schedule, + int shots_count, bool is_async = false); - /// Generates evolution kernels for the simulation. - static std::vector evolution_kernel(int num_qubits, const std::function> &, double)> &compute_step_matrix, const std::vector tlist, const std::vector>> &schedule_parameters); + /// Generates evolution kernels for the simulation. + static std::vector evolution_kernel( + int num_qubits, + const std::function> &, double)> + &compute_step_matrix, + const std::vector tlist, + const std::vector>> + &schedule_parameters); - /// Evolves a single quantum state under a given hamiltonian. - static evolve_result evolve_single(const operator_sum &hamiltonian, const std::map &dimensions, const std::shared_ptr &schedule, state initial_state, const std::vector &collapse_operators = {}, const std::vector &observables = {}, bool store_intermediate_results = false, std::shared_ptr> integrator = nullptr, std::optional shots_count = std::nullopt); + /// Evolves a single quantum state under a given hamiltonian. + static evolve_result + evolve_single(const operator_sum &hamiltonian, + const std::map &dimensions, + const std::shared_ptr &schedule, state initial_state, + const std::vector &collapse_operators = {}, + const std::vector &observables = {}, + bool store_intermediate_results = false, + std::shared_ptr> integrator = nullptr, + std::optional shots_count = std::nullopt); - /// Evolves a single or multiple quantum states under a given hamiltonian. - static std::vector evolve(const operator_sum &hamiltonian, const std::map &dimensions, const std::shared_ptr &schedule, const std::vector &initial_states, const std::vector &collapse_operators = {}, const std::vector &observables = {}, bool store_intermediate_results = false, std::shared_ptr> integrator = nullptr, std::optional shots_count = std::nullopt); + /// Evolves a single or multiple quantum states under a given hamiltonian. + static std::vector + evolve(const operator_sum &hamiltonian, const std::map &dimensions, + const std::shared_ptr &schedule, + const std::vector &initial_states, + const std::vector &collapse_operators = {}, + const std::vector &observables = {}, + bool store_intermediate_results = false, + std::shared_ptr> integrator = nullptr, + std::optional shots_count = std::nullopt); }; -} \ No newline at end of file +} // namespace cudaq \ No newline at end of file