Skip to content

Commit

Permalink
Add QObj gen customization point to AER backend
Browse files Browse the repository at this point in the history
This allows for general usage of this backend beside the default builtin qobj compiler.

Signed-off-by: Thien Nguyen <thien.md.nguyen@gmail.com>
  • Loading branch information
1tnguyen committed May 8, 2023
1 parent 1eadf8a commit 05164c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions quantum/plugins/ibm/aer/accelerator/aer_accelerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,14 @@ void AerAccelerator::initialize(const HeterogeneousMap &params) {
noise_model.clear();
m_simtype = "qasm";
connectivity.clear();

xacc_to_qobj = xacc::getCompiler("qobj");
if (params.stringExists("qobj-compiler") &&
(xacc::hasService<xacc::Compiler>(params.getString("qobj-compiler")) ||
xacc::hasContributedService<xacc::Compiler>(
params.getString("qobj-compiler")))) {
xacc_to_qobj = xacc::getCompiler(params.getString("qobj-compiler"));
} else {
xacc_to_qobj = xacc::getCompiler("qobj");
}
if (params.keyExists<int>("shots")) {
m_shots = params.get<int>("shots");
}
Expand Down

0 comments on commit 05164c1

Please sign in to comment.