.. index:: pair: class; QPanda::JsonConfigParam .. _doxid-class_q_panda_1_1_json_config_param: class QPanda::JsonConfigParam ============================= .. toctree:: :hidden: Overview ~~~~~~~~ json configuration parameter :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class JsonConfigParam { public: // methods bool :ref:`load_config`(const std::string config_data = :ref:`CONFIG_PATH`); rapidjson::Document& :target:`get_root_element`(); bool :target:`getMetadataConfig`( int& qubit_num, std::vector>& qubit_matrix ); bool :target:`getClassNameConfig`(std::map& class_names); bool :target:`getQuantumCloudConfig`(std::map& cloud_config); bool :target:`getQGateConfig`( std::vector& single_gates, std::vector& double_gates ); bool :target:`getQGateTimeConfig`(std::map<:ref:`GateType`, size_t>& gate_time); bool :target:`getInstructionConfig`(std::map>&); static bool :ref:`readAdjacentMatrix`( const rapidjson::Value& AdjacentMatrixElement, int& qubit_num, std::vector>& qubit_matrix ); static bool :ref:`loadQuantumTopoStructure`( const std::string& xmlStr, const std::string& dataElementStr, int& qubitsCnt, std::vector>& vec, const std::string configFile = "" ); }; .. _details-class_q_panda_1_1_json_config_param: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ json configuration parameter Methods ------- .. index:: pair: function; load_config .. _doxid-group___utilities_1ga67e19e97887a059cdff2bd39e5e51dc7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool load_config(const std::string config_data = :ref:`CONFIG_PATH`) Load config data. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - const - std::string It can be configuration file or configuration data, which can be distinguished by file suffix, so the configuration file must be end with ".json", default is CONFIG_PATH .. rubric:: Returns: Return false if any error occurs, otherwise return true .. index:: pair: function; readAdjacentMatrix .. _doxid-group___utilities_1ga7e179045bbde3f080538907729fb51c1: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool readAdjacentMatrix( const rapidjson::Value& AdjacentMatrixElement, int& qubit_num, std::vector>& qubit_matrix ) read topological structure from json config file .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - const - rapidjson::Value& json value * - int& - qubit number * - std::vector> - qubit matrix .. rubric:: Returns: bool .. index:: pair: function; loadQuantumTopoStructure .. _doxid-class_q_panda_1_1_json_config_param_1af6bcc59ff38732f3f147cb22e9f6015e: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool loadQuantumTopoStructure( const std::string& xmlStr, const std::string& dataElementStr, int& qubitsCnt, std::vector>& vec, const std::string configFile = "" ) load quantum circuit topological structure