DQCsim
|
Provides DQCsim's raw C API symbols in the dqcsim::raw
namespace.
More...
#include <cstdio>
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <new>
Go to the source code of this file.
Namespaces | |
dqcsim | |
Main DQCsim namespace. | |
dqcsim::raw | |
Namespace containing all the symbols defined by the C API. | |
Macros | |
#define | dqcs_log_trace(fmt, ...) |
Convenience macro for calling dqcs_log_format() with trace loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_debug(fmt, ...) |
Convenience macro for calling dqcs_log_format() with debug loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_info(fmt, ...) |
Convenience macro for calling dqcs_log_format() with info loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_note(fmt, ...) |
Convenience macro for calling dqcs_log_format() with note loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_warn(fmt, ...) |
Convenience macro for calling dqcs_log_format() with warn loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_error(fmt, ...) |
Convenience macro for calling dqcs_log_format() with error loglevel and automatically determined function name, filename, and line number. More... | |
#define | dqcs_log_fatal(fmt, ...) |
Convenience macro for calling dqcs_log_format() with fatal loglevel and automatically determined function name, filename, and line number. More... | |
Typedefs | |
using | dqcsim::raw::dqcs_handle_t = unsigned long long |
Type for a handle. More... | |
using | dqcsim::raw::dqcs_qubit_t = unsigned long long |
Type for a qubit reference. More... | |
using | dqcsim::raw::dqcs_plugin_state_t = void * |
Type for a plugin state. More... | |
using | dqcsim::raw::dqcs_cycle_t = long long |
Type for a simulation cycle timestamp. More... | |
Functions | |
dqcs_return_t | dqcsim::raw::dqcs_arb_assign (dqcs_handle_t dest, dqcs_handle_t src) |
Copies the data from one object to another. | |
ssize_t | dqcsim::raw::dqcs_arb_cbor_get (dqcs_handle_t arb, void *obj, size_t obj_size) |
Returns the JSON/CBOR object of an ArbData object in the form of a CBOR object. More... | |
dqcs_return_t | dqcsim::raw::dqcs_arb_cbor_set (dqcs_handle_t arb, const void *obj, size_t obj_size) |
Sets the JSON/CBOR object of an ArbData object by means of a CBOR object. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_clear (dqcs_handle_t arb) |
Clears the unstructured argument list. | |
ssize_t | dqcsim::raw::dqcs_arb_get_raw (dqcs_handle_t arb, ssize_t index, void *obj, size_t obj_size) |
Returns the unstructured string argument at the specified index. More... | |
ssize_t | dqcsim::raw::dqcs_arb_get_size (dqcs_handle_t arb, ssize_t index) |
Returns the size in bytes of the unstructured string argument at the specified index. More... | |
char * | dqcsim::raw::dqcs_arb_get_str (dqcs_handle_t arb, ssize_t index) |
Returns the unstructured string argument at the specified index. More... | |
dqcs_return_t | dqcsim::raw::dqcs_arb_insert_raw (dqcs_handle_t arb, ssize_t index, const void *obj, size_t obj_size) |
Inserts an unstructured raw argument into the list at the specified index. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_insert_str (dqcs_handle_t arb, ssize_t index, const char *s) |
Inserts an unstructured string argument into the list at the specified index. | |
char * | dqcsim::raw::dqcs_arb_json_get (dqcs_handle_t arb) |
Returns the JSON/CBOR object of an ArbData object in the form of a JSON string. More... | |
dqcs_return_t | dqcsim::raw::dqcs_arb_json_set (dqcs_handle_t arb, const char *json) |
Sets the JSON/CBOR object of an ArbData object by means of a JSON string. | |
ssize_t | dqcsim::raw::dqcs_arb_len (dqcs_handle_t arb) |
Returns the number of unstructured arguments, or -1 to indicate failure. | |
dqcs_handle_t | dqcsim::raw::dqcs_arb_new () |
Creates a new ArbData object. More... | |
dqcs_return_t | dqcsim::raw::dqcs_arb_pop (dqcs_handle_t arb) |
Pops an unstructured argument from the back of the list without returning it. | |
ssize_t | dqcsim::raw::dqcs_arb_pop_raw (dqcs_handle_t arb, void *obj, size_t obj_size) |
Pops an unstructured raw argument from the back of the list. More... | |
char * | dqcsim::raw::dqcs_arb_pop_str (dqcs_handle_t arb) |
Pops an unstructured string argument from the back of the list. More... | |
dqcs_return_t | dqcsim::raw::dqcs_arb_push_raw (dqcs_handle_t arb, const void *obj, size_t obj_size) |
Pushes an unstructured raw argument to the back of the list. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_push_str (dqcs_handle_t arb, const char *s) |
Pushes an unstructured string argument to the back of the list. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_remove (dqcs_handle_t arb, ssize_t index) |
Removes the specified unstructured string argument from the list. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_set_raw (dqcs_handle_t arb, ssize_t index, const void *obj, size_t obj_size) |
Replaces the unstructured argument at the specified index with the specified raw object. | |
dqcs_return_t | dqcsim::raw::dqcs_arb_set_str (dqcs_handle_t arb, ssize_t index, const char *s) |
Replaces the unstructured argument at the specified index with the specified string. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_cmd_iface_cmp (dqcs_handle_t cmd, const char *iface) |
Compares the interface ID of an ArbCmd with the given string. More... | |
char * | dqcsim::raw::dqcs_cmd_iface_get (dqcs_handle_t cmd) |
Returns the interface ID of an ArbCmd . More... | |
dqcs_handle_t | dqcsim::raw::dqcs_cmd_new (const char *iface, const char *oper) |
Creates a new ArbCmd object. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_cmd_oper_cmp (dqcs_handle_t cmd, const char *oper) |
Compares the operation ID of an ArbCmd with the given string. More... | |
char * | dqcsim::raw::dqcs_cmd_oper_get (dqcs_handle_t cmd) |
Returns the operation ID of an ArbCmd . More... | |
ssize_t | dqcsim::raw::dqcs_cq_len (dqcs_handle_t cq) |
Returns the number of ArbCmd objects in the given ArbCmd queue. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_cq_new () |
Creates a new ArbCmd queue object. More... | |
dqcs_return_t | dqcsim::raw::dqcs_cq_next (dqcs_handle_t cq) |
Advances an ArbCmd queue to the next command. More... | |
dqcs_return_t | dqcsim::raw::dqcs_cq_push (dqcs_handle_t cq, dqcs_handle_t cmd) |
Pushes an ArbCmd object into the given ArbCmd queue. More... | |
const char * | dqcsim::raw::dqcs_error_get () |
Returns a pointer to the latest error message. More... | |
void | dqcsim::raw::dqcs_error_set (const char *msg) |
Sets the latest error message string. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_controls (dqcs_handle_t gate) |
Returns a handle to a new qubit reference set containing the qubits that control this gate. | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_expand_control (dqcs_handle_t gate) |
Utility function that expands a gate matrix to account for all control qubits. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gate_has_controls (dqcs_handle_t gate) |
Returns whether the specified gate has control qubits. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gate_has_matrix (dqcs_handle_t gate) |
Returns whether a unitary matrix is associated with this gate. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gate_has_measures (dqcs_handle_t gate) |
Returns whether the specified gate measures any qubits. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gate_has_name (dqcs_handle_t gate) |
Returns whether the specified gate has a name. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gate_has_targets (dqcs_handle_t gate) |
Returns whether the specified gate has target qubits. | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_matrix (dqcs_handle_t gate) |
Returns a copy of the unitary matrix associated with this gate, if one exists. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_measures (dqcs_handle_t gate) |
Returns a handle to a new qubit reference set containing the qubits measured by this gate. | |
char * | dqcsim::raw::dqcs_gate_name (dqcs_handle_t gate) |
Returns the name of a custom gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_custom (const char *name, dqcs_handle_t targets, dqcs_handle_t controls, dqcs_handle_t measures, dqcs_handle_t matrix) |
Constructs a new custom gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_measurement (dqcs_handle_t measures, dqcs_handle_t matrix) |
Constructs a new measurement gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_predef (dqcs_predefined_gate_t gate_type, dqcs_handle_t qubits, dqcs_handle_t param_data) |
Constructs a new predefined unitary gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_predef_one (dqcs_predefined_gate_t gate_type, dqcs_qubit_t qa, dqcs_handle_t param_data) |
Constructs a new predefined unitary one-qubit gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_predef_three (dqcs_predefined_gate_t gate_type, dqcs_qubit_t qa, dqcs_qubit_t qb, dqcs_qubit_t qc, dqcs_handle_t param_data) |
Constructs a new predefined unitary three-qubit gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_predef_two (dqcs_predefined_gate_t gate_type, dqcs_qubit_t qa, dqcs_qubit_t qb, dqcs_handle_t param_data) |
Constructs a new predefined unitary two-qubit gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_prep (dqcs_handle_t targets, dqcs_handle_t matrix) |
Constructs a new prep gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_new_unitary (dqcs_handle_t targets, dqcs_handle_t controls, dqcs_handle_t matrix) |
Constructs a new unitary gate. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_reduce_control (dqcs_handle_t gate, double epsilon, bool ignore_gphase) |
Utility function that detects control qubits in the targets list of the gate by means of the gate matrix, and reduces them into controls qubits. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gate_targets (dqcs_handle_t gate) |
Returns a handle to a new qubit reference set containing the qubits targeted by this gate. | |
dqcs_gate_type_t | dqcsim::raw::dqcs_gate_type (dqcs_handle_t gate) |
Returns the gate type of the given gate. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_custom (dqcs_handle_t gm, void(*key_free)(void *key_data), void *key_data, dqcs_bool_return_t(*detector)(const void *user_data, dqcs_handle_t gate, dqcs_handle_t *qubits, dqcs_handle_t *param_data), void(*detector_user_free)(void *user_data), void *detector_user_data, dqcs_handle_t(*constructor)(const void *user_data, dqcs_handle_t qubits, dqcs_handle_t param_data), void(*constructor_user_free)(void *user_data), void *constructor_user_data) |
Adds a fully customizable gate mapping to the given gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_custom_unitary (dqcs_handle_t gm, void(*key_free)(void *key_data), void *key_data, dqcs_bool_return_t(*detector)(const void *user_data, dqcs_handle_t matrix, size_t num_controls, dqcs_handle_t *param_data), void(*detector_user_free)(void *user_data), void *detector_user_data, dqcs_handle_t(*constructor)(const void *user_data, dqcs_handle_t *param_data, intptr_t *num_controls), void(*constructor_user_free)(void *user_data), void *constructor_user_data) |
Adds a custom unitary gate mapping to the given gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_fixed_unitary (dqcs_handle_t gm, void(*key_free)(void *key_data), void *key_data, dqcs_handle_t matrix, intptr_t num_controls, double epsilon, bool ignore_gphase) |
Adds a unitary gate mapping for the given gate matrix to the given gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_measure (dqcs_handle_t gm, void(*key_free)(void *user_data), void *key_data, intptr_t num_measures, dqcs_handle_t basis, double epsilon) |
Adds a measurement gate mapping to the given gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_predef_unitary (dqcs_handle_t gm, void(*key_free)(void *user_data), void *key_data, dqcs_predefined_gate_t gate, intptr_t num_controls, double epsilon, bool ignore_gphase) |
Adds a unitary gate mapping for the given DQCsim-defined gate to the given gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_gm_add_prep (dqcs_handle_t gm, void(*key_free)(void *user_data), void *key_data, intptr_t num_targets, dqcs_handle_t basis, double epsilon) |
Adds a prep gate mapping to the given gate map. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gm_construct (dqcs_handle_t gm, const void *key_data, dqcs_handle_t qubits, dqcs_handle_t param_data) |
Uses a gate map object to construct a multi-qubit DQCsim gate from the plugin's representation. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gm_construct_one (dqcs_handle_t gm, const void *key_data, dqcs_qubit_t qa, dqcs_handle_t param_data) |
Uses a gate map object to construct a one-qubit DQCsim gate from the plugin's representation. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gm_construct_three (dqcs_handle_t gm, const void *key_data, dqcs_qubit_t qa, dqcs_qubit_t qb, dqcs_qubit_t qc, dqcs_handle_t param_data) |
Uses a gate map object to construct a three-qubit DQCsim gate from the plugin's representation. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gm_construct_two (dqcs_handle_t gm, const void *key_data, dqcs_qubit_t qa, dqcs_qubit_t qb, dqcs_handle_t param_data) |
Uses a gate map object to construct a two-qubit DQCsim gate from the plugin's representation. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_gm_detect (dqcs_handle_t gm, dqcs_handle_t gate, const void **key_data, dqcs_handle_t *qubits, dqcs_handle_t *param_data) |
Uses a gate map object to convert an incoming DQCsim gate to the plugin's representation. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_gm_new (bool strip_qubit_refs, bool strip_data, bool(*key_cmp)(const void *, const void *), uint64_t(*key_hash)(const void *)) |
Constructs a new gate map. More... | |
dqcs_return_t | dqcsim::raw::dqcs_handle_delete (dqcs_handle_t handle) |
Destroys the object associated with a handle. More... | |
dqcs_return_t | dqcsim::raw::dqcs_handle_delete_all () |
Deletes all handles for the current thread. More... | |
char * | dqcsim::raw::dqcs_handle_dump (dqcs_handle_t handle) |
Returns a debug dump of the object associated with the given handle. More... | |
dqcs_return_t | dqcsim::raw::dqcs_handle_leak_check () |
Succeeds only if there are no live handles in the current thread. More... | |
dqcs_handle_type_t | dqcsim::raw::dqcs_handle_type (dqcs_handle_t handle) |
Returns the type of object associated with the given handle. | |
dqcs_return_t | dqcsim::raw::dqcs_log_raw (dqcs_loglevel_t level, const char *module, const char *file, uint32_t line_nr, const char *message) |
Primitive API for sending a log message using the current logger. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mat_add_controls (dqcs_handle_t mat, size_t number_of_controls) |
Constructs a controlled matrix from the given matrix. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_mat_approx_eq (dqcs_handle_t a, dqcs_handle_t b, double epsilon, bool ignore_gphase) |
Approximately compares two matrices. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_mat_approx_unitary (dqcs_handle_t matrix, double epsilon) |
Returns whether the matrix is approximately unitary. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mat_basis (dqcs_basis_t basis) |
Constructs a matrix with the eigenvectors of one of the Pauli matrices as column vectors. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_mat_basis_approx_eq (dqcs_handle_t a, dqcs_handle_t b, double epsilon) |
Approximately compares two basis matrices. More... | |
ssize_t | dqcsim::raw::dqcs_mat_dimension (dqcs_handle_t mat) |
Returns the dimension (number of rows == number of columns) of the given matrix. More... | |
double * | dqcsim::raw::dqcs_mat_get (dqcs_handle_t mat) |
Returns a copy of the contained matrix as a C array. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_mat_is_predef (dqcs_handle_t mat, dqcs_predefined_gate_t gate_type, dqcs_handle_t *param_data, double epsilon, bool ignore_gphase) |
Returns whether this matrix is of the given predefined form and, if it is, any parameters needed to describe it. More... | |
ssize_t | dqcsim::raw::dqcs_mat_len (dqcs_handle_t mat) |
Returns the number of complex entries in the given matrix. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mat_new (size_t num_qubits, const double *matrix) |
Constructs a new gate matrix. More... | |
ssize_t | dqcsim::raw::dqcs_mat_num_qubits (dqcs_handle_t mat) |
Returns the number of qubits targeted by the given matrix. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mat_predef (dqcs_predefined_gate_t gate_type, dqcs_handle_t param_data) |
Constructs a new gate matrix for one of DQCsim's predefined gates. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mat_strip_control (dqcs_handle_t mat, double epsilon, bool ignore_global_phase, ssize_t **control_indices) |
Splits a controlled matrix into its non-controlled submatrix and the indices of the control qubits. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_meas_new (dqcs_qubit_t qubit, dqcs_measurement_t value) |
Constructs a new measurement object. More... | |
dqcs_qubit_t | dqcsim::raw::dqcs_meas_qubit_get (dqcs_handle_t meas) |
Returns the qubit reference associated with a measurement object. | |
dqcs_return_t | dqcsim::raw::dqcs_meas_qubit_set (dqcs_handle_t meas, dqcs_qubit_t qubit) |
Sets the qubit reference associated with a measurement object. | |
dqcs_measurement_t | dqcsim::raw::dqcs_meas_value_get (dqcs_handle_t meas) |
Returns the measurement value associated with a measurement object. | |
dqcs_return_t | dqcsim::raw::dqcs_meas_value_set (dqcs_handle_t meas, dqcs_measurement_t value) |
Sets the measurement value associated with a measurement object. | |
dqcs_bool_return_t | dqcsim::raw::dqcs_mset_contains (dqcs_handle_t mset, dqcs_qubit_t qubit) |
Returns whether the given qubit measurement set contains data for the given qubit. | |
dqcs_handle_t | dqcsim::raw::dqcs_mset_get (dqcs_handle_t mset, dqcs_qubit_t qubit) |
Returns a copy of the measurement result for the given qubit from a measurement result set. | |
ssize_t | dqcsim::raw::dqcs_mset_len (dqcs_handle_t mset) |
Returns the number of qubits measurements in the given measurement set. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mset_new () |
Creates a new set of qubit measurement results. More... | |
dqcs_return_t | dqcsim::raw::dqcs_mset_remove (dqcs_handle_t mset, dqcs_qubit_t qubit) |
Removes the measurement result for the given qubit from a measurement result set. | |
dqcs_return_t | dqcsim::raw::dqcs_mset_set (dqcs_handle_t mset, dqcs_handle_t meas) |
Adds a measurement result to a measurement result set. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_mset_take (dqcs_handle_t mset, dqcs_qubit_t qubit) |
Returns the measurement result for the given qubit from a measurement result set and removes it from the set. | |
dqcs_handle_t | dqcsim::raw::dqcs_mset_take_any (dqcs_handle_t mset) |
Returns the measurement result for any of the qubits contained in a measurement result set and removes it from the set. More... | |
double | dqcsim::raw::dqcs_pcfg_accept_timeout_get (dqcs_handle_t pcfg) |
Returns the configured timeout for the plugin process to connect to DQCsim. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_accept_timeout_set (dqcs_handle_t pcfg, double timeout) |
Configures the timeout for the plugin process to connect to DQCsim. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_env_set (dqcs_handle_t pcfg, const char *key, const char *value) |
Overrides an environment variable for the plugin process. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_env_unset (dqcs_handle_t pcfg, const char *key) |
Removes/unsets an environment variable for the plugin process. More... | |
char * | dqcsim::raw::dqcs_pcfg_executable (dqcs_handle_t pcfg) |
Returns the configured executable path for the given plugin process. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_init_cmd (dqcs_handle_t pcfg, dqcs_handle_t cmd) |
Appends an ArbCmd to the list of initialization commands of a plugin process. More... | |
char * | dqcsim::raw::dqcs_pcfg_name (dqcs_handle_t pcfg) |
Returns the configured name for the given plugin process. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_pcfg_new (dqcs_plugin_type_t typ, const char *name, const char *spec) |
Creates a new plugin process configuration object using sugared syntax. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_pcfg_new_raw (dqcs_plugin_type_t typ, const char *name, const char *executable, const char *script) |
Creates a new plugin process configuration object using raw paths. More... | |
char * | dqcsim::raw::dqcs_pcfg_script (dqcs_handle_t pcfg) |
Returns the configured script path for the given plugin process. More... | |
double | dqcsim::raw::dqcs_pcfg_shutdown_timeout_get (dqcs_handle_t pcfg) |
Returns the configured timeout for the plugin process to shut down gracefully. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_shutdown_timeout_set (dqcs_handle_t pcfg, double timeout) |
Configures the timeout for the plugin process to shut down gracefully. More... | |
dqcs_loglevel_t | dqcsim::raw::dqcs_pcfg_stderr_mode_get (dqcs_handle_t pcfg) |
Returns the configured stderr capture mode for the specified plugin process. | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_stderr_mode_set (dqcs_handle_t pcfg, dqcs_loglevel_t level) |
Configures the capture mode for the stderr stream of the specified plugin process. | |
dqcs_loglevel_t | dqcsim::raw::dqcs_pcfg_stdout_mode_get (dqcs_handle_t pcfg) |
Returns the configured stdout capture mode for the specified plugin process. | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_stdout_mode_set (dqcs_handle_t pcfg, dqcs_loglevel_t level) |
Configures the capture mode for the stdout stream of the specified plugin process. | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_tee (dqcs_handle_t pcfg, dqcs_loglevel_t verbosity, const char *filename) |
Configures a plugin process to also output its log messages to a file. More... | |
dqcs_plugin_type_t | dqcsim::raw::dqcs_pcfg_type (dqcs_handle_t pcfg) |
Returns the type of the given plugin process configuration. | |
dqcs_loglevel_t | dqcsim::raw::dqcs_pcfg_verbosity_get (dqcs_handle_t pcfg) |
Returns the configured verbosity for the given plugin process. | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_verbosity_set (dqcs_handle_t pcfg, dqcs_loglevel_t level) |
Configures the logging verbosity for the given plugin process. | |
char * | dqcsim::raw::dqcs_pcfg_work_get (dqcs_handle_t pcfg) |
Returns the configured working directory for the given plugin process. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pcfg_work_set (dqcs_handle_t pcfg, const char *work) |
Overrides the working directory for the plugin process. | |
char * | dqcsim::raw::dqcs_pdef_author (dqcs_handle_t pdef) |
Returns the plugin author for the given plugin definition object. More... | |
char * | dqcsim::raw::dqcs_pdef_name (dqcs_handle_t pdef) |
Returns the plugin name for the given plugin definition object. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_pdef_new (dqcs_plugin_type_t typ, const char *name, const char *author, const char *version) |
Creates a new PluginDefinition object. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_advance_cb (dqcs_handle_t pdef, dqcs_return_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_cycle_t cycles), void(*user_free)(void *user_data), void *user_data) |
Sets the callback for advancing time for operators and backends. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_allocate_cb (dqcs_handle_t pdef, dqcs_return_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t qubits, dqcs_handle_t alloc_cmds), void(*user_free)(void *user_data), void *user_data) |
Sets the qubit allocation callback for operators and backends. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_drop_cb (dqcs_handle_t pdef, dqcs_return_t(*callback)(void *user_data, dqcs_plugin_state_t state), void(*user_free)(void *user_data), void *user_data) |
Sets the user logic drop/cleanup callback. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_free_cb (dqcs_handle_t pdef, dqcs_return_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t qubits), void(*user_free)(void *user_data), void *user_data) |
Sets the qubit deallocation callback for operators and backends. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_gate_cb (dqcs_handle_t pdef, dqcs_handle_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t gate), void(*user_free)(void *user_data), void *user_data) |
Sets the gate execution callback for operators and backends. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_host_arb_cb (dqcs_handle_t pdef, dqcs_handle_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t cmd), void(*user_free)(void *user_data), void *user_data) |
Sets the callback function function for handling an arb from the host. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_initialize_cb (dqcs_handle_t pdef, dqcs_return_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t init_cmds), void(*user_free)(void *user_data), void *user_data) |
Sets the user logic initialization callback. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_modify_measurement_cb (dqcs_handle_t pdef, dqcs_handle_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t meas), void(*user_free)(void *user_data), void *user_data) |
Sets the measurement modification callback for operators. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_run_cb (dqcs_handle_t pdef, dqcs_handle_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t args), void(*user_free)(void *user_data), void *user_data) |
Sets the run callback for frontends. More... | |
dqcs_return_t | dqcsim::raw::dqcs_pdef_set_upstream_arb_cb (dqcs_handle_t pdef, dqcs_handle_t(*callback)(void *user_data, dqcs_plugin_state_t state, dqcs_handle_t cmd), void(*user_free)(void *user_data), void *user_data) |
Sets the callback function for handling an arb from upstream for operators and backends. More... | |
dqcs_plugin_type_t | dqcsim::raw::dqcs_pdef_type (dqcs_handle_t pdef) |
Returns the plugin type for the given plugin definition object. | |
char * | dqcsim::raw::dqcs_pdef_version (dqcs_handle_t pdef) |
Returns the plugin version for the given plugin definition object. More... | |
dqcs_cycle_t | dqcsim::raw::dqcs_plugin_advance (dqcs_plugin_state_t plugin, dqcs_cycle_t cycles) |
Tells the downstream plugin to run for the specified number of cycles. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_allocate (dqcs_plugin_state_t plugin, uintptr_t num_qubits, dqcs_handle_t cq) |
Allocate the given number of downstream qubits. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_arb (dqcs_plugin_state_t plugin, dqcs_handle_t cmd) |
Sends an arbitrary command downstream. More... | |
dqcs_return_t | dqcsim::raw::dqcs_plugin_free (dqcs_plugin_state_t plugin, dqcs_handle_t qbset) |
Free the given downstream qubits. More... | |
dqcs_return_t | dqcsim::raw::dqcs_plugin_gate (dqcs_plugin_state_t plugin, dqcs_handle_t gate) |
Tells the downstream plugin to execute a gate. More... | |
dqcs_cycle_t | dqcsim::raw::dqcs_plugin_get_cycle (dqcs_plugin_state_t plugin) |
Returns the current value of the downstream cycle counter. More... | |
dqcs_cycle_t | dqcsim::raw::dqcs_plugin_get_cycles_between_measures (dqcs_plugin_state_t plugin, dqcs_qubit_t qubit) |
Returns the number of downstream cycles between the last two measurements of the given downstream qubit. More... | |
dqcs_cycle_t | dqcsim::raw::dqcs_plugin_get_cycles_since_measure (dqcs_plugin_state_t plugin, dqcs_qubit_t qubit) |
Returns the number of downstream cycles since the latest measurement of the given downstream qubit. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_get_measurement (dqcs_plugin_state_t plugin, dqcs_qubit_t qubit) |
Returns the latest measurement of the given downstream qubit. More... | |
double | dqcsim::raw::dqcs_plugin_random_f64 (dqcs_plugin_state_t plugin) |
Generates a random floating point number using the simulator random seed. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_random_u64 (dqcs_plugin_state_t plugin) |
Generates a random unsigned 64-bit number using the simulator random seed. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_recv (dqcs_plugin_state_t plugin) |
Waits for a message from the host. More... | |
dqcs_return_t | dqcsim::raw::dqcs_plugin_run (dqcs_handle_t pdef, const char *simulator) |
Executes a plugin in the current thread. More... | |
dqcs_return_t | dqcsim::raw::dqcs_plugin_send (dqcs_plugin_state_t plugin, dqcs_handle_t arb) |
Sends a message to the host. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_plugin_start (dqcs_handle_t pdef, const char *simulator) |
Executes a plugin in a worker thread. More... | |
dqcs_return_t | dqcsim::raw::dqcs_plugin_wait (dqcs_handle_t pjoin) |
Waits for a plugin worker thread to finish executing. More... | |
dqcs_bool_return_t | dqcsim::raw::dqcs_qbset_contains (dqcs_handle_t qbset, dqcs_qubit_t qubit) |
Returns whether the given qubit set contains the given qubit. | |
dqcs_handle_t | dqcsim::raw::dqcs_qbset_copy (dqcs_handle_t qbset) |
Returns a copy of the given qubit set, intended for non-destructive iteration. | |
ssize_t | dqcsim::raw::dqcs_qbset_len (dqcs_handle_t qbset) |
Returns the number of qubits in the given set. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_qbset_new () |
Creates a new set of qubit references. More... | |
dqcs_qubit_t | dqcsim::raw::dqcs_qbset_pop (dqcs_handle_t qbset) |
Pops a qubit reference off of a qubit reference set. More... | |
dqcs_return_t | dqcsim::raw::dqcs_qbset_push (dqcs_handle_t qbset, dqcs_qubit_t qubit) |
Pushes a qubit reference into a qubit reference set. More... | |
dqcs_loglevel_t | dqcsim::raw::dqcs_scfg_dqcsim_verbosity_get (dqcs_handle_t scfg) |
Returns the configured verbosity for DQCsim's own messages. | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_dqcsim_verbosity_set (dqcs_handle_t scfg, dqcs_loglevel_t level) |
Configures the logging verbosity for DQCsim's own messages. | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_log_callback (dqcs_handle_t scfg, dqcs_loglevel_t verbosity, void(*callback)(void *user_data, const char *message, const char *logger, dqcs_loglevel_t level, const char *module, const char *file, uint32_t line, uint64_t time_s, uint32_t time_ns, uint32_t pid, uint64_t tid), void(*user_free)(void *user_data), void *user_data) |
Configures DQCsim to also output its log messages to callback function. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_scfg_new () |
Constructs an empty simulation configuration. More... | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_push_plugin (dqcs_handle_t scfg, dqcs_handle_t xcfg) |
Appends a plugin to a simulation configuration. More... | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_repro_disable (dqcs_handle_t scfg) |
Disables the reproduction logging system. More... | |
dqcs_path_style_t | dqcsim::raw::dqcs_scfg_repro_path_style_get (dqcs_handle_t scfg) |
Returns the path style used when writing reproduction files. | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_repro_path_style_set (dqcs_handle_t scfg, dqcs_path_style_t path_style) |
Sets the path style used when writing reproduction files. | |
uint64_t | dqcsim::raw::dqcs_scfg_seed_get (dqcs_handle_t scfg) |
Returns the configured random seed. More... | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_seed_set (dqcs_handle_t scfg, uint64_t seed) |
Configures the random seed that the simulation should use. More... | |
dqcs_loglevel_t | dqcsim::raw::dqcs_scfg_stderr_verbosity_get (dqcs_handle_t scfg) |
Returns the configured stderr sink verbosity for a simulation. More... | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_stderr_verbosity_set (dqcs_handle_t scfg, dqcs_loglevel_t level) |
Configures the stderr sink verbosity for a simulation. More... | |
dqcs_return_t | dqcsim::raw::dqcs_scfg_tee (dqcs_handle_t scfg, dqcs_loglevel_t verbosity, const char *filename) |
Configures DQCsim to also output its log messages to a file. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_sim_arb (dqcs_handle_t sim, const char *name, dqcs_handle_t cmd) |
Sends an ArbCmd message to one of the plugins, referenced by name. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_sim_arb_idx (dqcs_handle_t sim, ssize_t index, dqcs_handle_t cmd) |
Sends an ArbCmd message to one of the plugins, referenced by index. More... | |
char * | dqcsim::raw::dqcs_sim_get_author (dqcs_handle_t sim, const char *name) |
Queries the author of a plugin, referenced by instance name. More... | |
char * | dqcsim::raw::dqcs_sim_get_author_idx (dqcs_handle_t sim, ssize_t index) |
Queries the author of a plugin, referenced by index. More... | |
char * | dqcsim::raw::dqcs_sim_get_name (dqcs_handle_t sim, const char *name) |
Queries the implementation name of a plugin, referenced by instance name. More... | |
char * | dqcsim::raw::dqcs_sim_get_name_idx (dqcs_handle_t sim, ssize_t index) |
Queries the implementation name of a plugin, referenced by index. More... | |
char * | dqcsim::raw::dqcs_sim_get_version (dqcs_handle_t sim, const char *name) |
Queries the version of a plugin, referenced by instance name. More... | |
char * | dqcsim::raw::dqcs_sim_get_version_idx (dqcs_handle_t sim, ssize_t index) |
Queries the version of a plugin, referenced by index. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_sim_new (dqcs_handle_t scfg) |
Constructs a DQCsim simulation. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_sim_recv (dqcs_handle_t sim) |
Waits for the simulated accelerator to send a message to us. More... | |
dqcs_return_t | dqcsim::raw::dqcs_sim_send (dqcs_handle_t sim, dqcs_handle_t data) |
Sends a message to the simulated accelerator. More... | |
dqcs_return_t | dqcsim::raw::dqcs_sim_start (dqcs_handle_t sim, dqcs_handle_t data) |
Starts a program on the simulated accelerator. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_sim_wait (dqcs_handle_t sim) |
Waits for the simulated accelerator to finish its current program. More... | |
dqcs_return_t | dqcsim::raw::dqcs_sim_write_reproduction_file (dqcs_handle_t sim, const char *filename) |
Writes a reproduction file for the simulation so far. | |
dqcs_return_t | dqcsim::raw::dqcs_sim_yield (dqcs_handle_t sim) |
Yields to the simulator. More... | |
dqcs_return_t | dqcsim::raw::dqcs_tcfg_init_cmd (dqcs_handle_t tcfg, dqcs_handle_t cmd) |
Appends an ArbCmd to the list of initialization commands of a plugin thread. More... | |
char * | dqcsim::raw::dqcs_tcfg_name (dqcs_handle_t tcfg) |
Returns the configured name for the given plugin thread. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_tcfg_new (dqcs_handle_t pdef, const char *name) |
Creates a new plugin thread configuration object from a plugin definition. More... | |
dqcs_handle_t | dqcsim::raw::dqcs_tcfg_new_raw (dqcs_plugin_type_t plugin_type, const char *name, void(*callback)(void *user_data, const char *simulator), void(*user_free)(void *user_data), void *user_data) |
Creates a new plugin thread configuration object from a callback. More... | |
dqcs_return_t | dqcsim::raw::dqcs_tcfg_tee (dqcs_handle_t tcfg, dqcs_loglevel_t verbosity, const char *filename) |
Configures a plugin thread to also output its log messages to a file. More... | |
dqcs_plugin_type_t | dqcsim::raw::dqcs_tcfg_type (dqcs_handle_t tcfg) |
Returns the type of the given plugin thread configuration. | |
dqcs_loglevel_t | dqcsim::raw::dqcs_tcfg_verbosity_get (dqcs_handle_t tcfg) |
Returns the configured verbosity for the given plugin thread. | |
dqcs_return_t | dqcsim::raw::dqcs_tcfg_verbosity_set (dqcs_handle_t tcfg, dqcs_loglevel_t level) |
Configures the logging verbosity for the given plugin thread. | |
Provides DQCsim's raw C API symbols in the dqcsim::raw
namespace.
This is file is functionally identical to dqcsim.h
, but doesn't pollute the global namespace.
Definition in file cdqcsim.
#define dqcs_log_trace | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with trace loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_debug | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with debug loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_info | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with info loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_note | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with note loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_warn | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with warn loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_error | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with error loglevel and automatically determined function name, filename, and line number.
#define dqcs_log_fatal | ( | fmt, | |
... | |||
) |
Convenience macro for calling dqcs_log_format()
with fatal loglevel and automatically determined function name, filename, and line number.