class QPanda::OptBMTQAllocator

Subgraph Isomorphism based Qubit Allocator. This QAllocator is split into 3 phases: 1.Partitions the program into a number of smaller programs, and find all* subgraph isomorphisms from the graph of that program to the coupling graph (architecture); 2.Dynamic programming that tests all combinations of subgraph isomorphisms, while estimating the cost of glueing themtogether; 3.Reconstructs the selected sequence of subgraph isomorphismsinto a program.

#include <OBMTQMapping.h>

class OptBMTQAllocator: public QPanda::AbstractQubitMapping
{
public:
    // typedefs

    typedef OptBMTQAllocator* Ref;
    typedef std::unique_ptr<OptBMTQAllocator> uRef;

    // fields

    std::vector<std::vector<double>> mCnotReliability;
    std::vector<std::vector<double>> mSwapDist;
    std::vector<double> mMeaReliability;
    double mCirReliability = 1.0;

    // methods

    static uRef Create(
        QPanda::ArchGraph::sRef ag,
        bool optimization = false,
        uint32_t max_partial = (std::numeric_limits<uint32_t>::max)(),
        uint32_t max_children = (std::numeric_limits<uint32_t>::max)()
        );

    static QPanda::ArchGraph::sRef build_arch_graph(const std::string& config_data = CONFIG_PATH);
    void setChildrenSelector(CandidateSelector::uRef sel);
};

Inherited Members

public:
    // typedefs

    typedef AbstractQubitMapping* Ref;
    typedef std::unique_ptr<AbstractQubitMapping> uRef;

    // methods

    bool run(QPanda::QProg prog, QPanda::QuantumMachine* qvm);
    void setGateWeightMap(const GateWeightMap& weightMap);
    const Mapping& get_final_mapping() const;
    const Mapping& get_init_mapping() const;
    QPanda::QProg get_mapped_prog() const;