13 #ifndef IBM_PULSE_INSTRUCTION_HPP_ 14 #define IBM_PULSE_INSTRUCTION_HPP_ 16 #include "Instruction.hpp" 17 #include "Cloneable.hpp" 27 std::vector<std::size_t> qbits;
32 std::vector<InstructionParameter> parameters;
37 parameters = {std::string(
""), (int)0, 0.0,
38 std::vector<std::complex<double>>{}};
41 : _name(name), parameters(params) {}
43 std::vector<InstructionParameter> params)
44 : _name(name), parameters(params), qbits(bits) {}
46 : _name(inst._name), parameters(inst.parameters), qbits(inst.qbits) {}
48 const std::string
name()
const override {
return _name; }
51 const std::string toString()
override {
52 return "{\"name\":" + _name +
", \"channel\":" + parameters[0].toString() +
53 ", \"time\": " + parameters[1].toString() +
54 ", \"phase\": " + parameters[2].toString() +
"}";
57 const std::vector<std::size_t> bits()
override {
return qbits; }
58 void setBits(
const std::vector<std::size_t> bits)
override { qbits = bits; }
61 getParameter(
const std::size_t idx)
const override {
62 return parameters[idx];
64 std::vector<InstructionParameter> getParameters()
override {
67 void setParameter(
const std::size_t idx,
69 parameters[idx] = inst;
71 const int nParameters()
override {
return 4; }
72 bool isParameterized()
override {
return true; }
74 void mapBits(std::vector<std::size_t> bitMap)
override {}
75 bool isComposite()
override {
return false; }
77 bool isEnabled()
override {
return enabled; }
78 void disable()
override { enabled =
false; }
79 void enable()
override { enabled =
true; }
80 const bool isAnalog()
const override {
return true; }
82 const int nRequiredBits()
const override {
return 1; }
87 std::shared_ptr<Instruction> clone()
override {
88 return std::make_shared<PulseInstruction>(_name, qbits, parameters);
const std::string name() const override
Definition: pulse_instruction.hpp:48
const std::string description() const override
Definition: pulse_instruction.hpp:49
Definition: Accelerator.hpp:25
Definition: pulse_instruction.hpp:22
Definition: Instruction.hpp:100