Skip to content

Commit b74a9a6

Browse files
committed
rename folder and a type fix
Signed-off-by: Bettina Heim <[email protected]>
1 parent 86aaeb2 commit b74a9a6

12 files changed

+13
-14
lines changed

runtime/cudaq/dynamics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
#pragma once
1010

11-
#include "cudaq/dynamics/operators.h"
11+
#include "cudaq/operator/operators.h"

runtime/cudaq/dynamics/operator_sum.cpp renamed to runtime/cudaq/operator/operator_sum.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ operator_sum::operator_sum(const std::vector<product_operator> &terms)
2020
: m_terms(terms) {}
2121

2222
/// Canonicalize the terms of the operator sum.
23-
std::vector<std::tuple<scalar_operator, elementary_operator>>
24-
operator_sum::_canonical_terms() const {
23+
std::vector<sdt::variant<scalar_operator, elementary_operator>>
24+
operator_sum::canonical_terms() const {
2525
std::vector<sdt::variant<scalar_operator, elementary_operator>>
2626
canonicalized_terms;
2727

@@ -67,7 +67,7 @@ operator_sum::_canonical_terms() const {
6767
/// Canonicalize the operator sum into a new instance
6868
operator_sum operator_sum::canonicalize() const {
6969
std::vector<product_operator> canonical_terms;
70-
for (const auto &[scalar, elementary] : _canonical_terms()) {
70+
for (const auto &[scalar, elementary] : canonical_terms()) {
7171
canonical_terms.emplace_back(product_operator({scalar, elementary}));
7272
}
7373

@@ -76,7 +76,7 @@ operator_sum operator_sum::canonicalize() const {
7676

7777
/// Equality operator to compare canonicalized terms.
7878
bool operator_sum::operator==(const operator_sum &other) const {
79-
return _canonical_terms() == other._canonical_terms;
79+
return canonical_terms() == other.canonical_terms;
8080
}
8181

8282
/// Get unique degrees of freedom in canonical order.
@@ -96,8 +96,9 @@ std::vector<int> operator_sum::degrees() const {
9696
}
9797

9898
/// Aggregate parameters of all terms.
99-
std::map<std::string, std::complex<double>> operator_sum::parameters() const {
100-
std::map<std::string, std::complex<double>> param_map;
99+
/*
100+
std::map<std::string, std::string> operator_sum::parameters() const {
101+
std::map<std::string, std::string> param_map;
101102
102103
for (const auto &term : m_terms) {
103104
for (const auto &op_variant : term.get_terms()) {
@@ -112,6 +113,7 @@ std::map<std::string, std::complex<double>> operator_sum::parameters() const {
112113
113114
return param_map;
114115
}
116+
*/
115117

116118
/// Check if the operator sum acts as a spin operator.
117119
bool operator_sum::_is_spinop() const {

runtime/cudaq/dynamics/operators.h renamed to runtime/cudaq/operator/operators.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ class operator_sum {
3535
private:
3636
std::vector<product_operator> m_terms;
3737

38-
std::vector<std::tuple<scalar_operator, elementary_operator>>
39-
canonicalize_product(product_operator &prod) const;
40-
41-
std::vector<std::tuple<scalar_operator, elementary_operator>>
42-
_canonical_terms() const;
38+
std::vector<sdt::variant<scalar_operator, elementary_operator>>
39+
canonical_terms() const;
4340

4441
public:
4542
/// @brief Empty constructor that a user can aggregate terms into.
@@ -57,7 +54,7 @@ class operator_sum {
5754
/// order.
5855
std::vector<int> degrees() const;
5956

60-
std::map<std::string, std::complex<double>> parameters() const;
57+
//std::map<std::string, std::string> parameters() const;
6158

6259
bool _is_spinop() const;
6360

@@ -347,7 +344,7 @@ class elementary_operator : public product_operator {
347344
/// This will be enabled once we can handle generalized callback function
348345
/// arguments.
349346
/// @FIXME: Not needed until generalizing the function arguments.
350-
std::map<std::string, std::complex<double>> parameters;
347+
std::map<std::string, std::string> parameters;
351348
std::string id;
352349

353350
// /// @brief Creates a representation of the operator as `pauli_word` that

0 commit comments

Comments
 (0)