Skip to content

Commit

Permalink
reduce overheads of unnecessary copy of config
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorii committed Mar 22, 2023
1 parent d9d66f2 commit 6ccf398
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/transpile/circuitopt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@ class CircuitOptimization {
const Operations::OpSet &opset,
ExperimentResult &result) const = 0;

virtual void set_config(const Config &config);

protected:
Config config_;
virtual void set_config(const Config &config){};
};

void CircuitOptimization::set_config(const Config &config) { config_ = config; }

//-------------------------------------------------------------------------
} // end namespace Transpile
} // end namespace AER
Expand Down
2 changes: 1 addition & 1 deletion src/transpile/fusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ void Fusion::set_config(const Config &config) {
config.get_option(threshold, "fusion_threshold");

for (std::shared_ptr<Fuser> &fuser : fusers)
fuser->set_config(config_);
fuser->set_config(config);

config.get_option(allow_kraus, "fusion_allow_kraus");
config.get_option(allow_superop, "fusion_allow_superop");
Expand Down

0 comments on commit 6ccf398

Please sign in to comment.