[][src]Module dqcsim::bindings

This module provides a C interface to the DQCsim simulator.

Refer to the generated API docs for more information.

Structs

dqcs_plugin_state_t

Type for a plugin state.

Enums

dqcs_basis_t

Enumeration of Pauli bases.

dqcs_bool_return_t

Return type for functions that normally return a boolean but can also fail.

dqcs_gate_type_t

Types of DQCsim gates.

dqcs_handle_type_t

Enumeration of types that can be associated with a handle.

dqcs_loglevel_t

Enumeration of loglevels and logging modes.

dqcs_measurement_t

Qubit measurement value.

dqcs_path_style_t

Reproduction file path style.

dqcs_plugin_type_t

Enumeration of the three types of plugins.

dqcs_predefined_gate_t

Enumeration of gates defined by DQCsim.

dqcs_return_t

Default return type for functions that don't need to return anything.

Functions

dqcs_arb_assign

Copies the data from one object to another.

dqcs_arb_cbor_get

Returns the JSON/CBOR object of an ArbData object in the form of a CBOR object.

dqcs_arb_cbor_set

Sets the JSON/CBOR object of an ArbData object by means of a CBOR object.

dqcs_arb_clear

Clears the unstructured argument list.

dqcs_arb_get_raw

Returns the unstructured string argument at the specified index.

dqcs_arb_get_size

Returns the size in bytes of the unstructured string argument at the specified index.

dqcs_arb_get_str

Returns the unstructured string argument at the specified index.

dqcs_arb_insert_raw

Inserts an unstructured raw argument into the list at the specified index.

dqcs_arb_insert_str

Inserts an unstructured string argument into the list at the specified index.

dqcs_arb_json_get

Returns the JSON/CBOR object of an ArbData object in the form of a JSON string.

dqcs_arb_json_set

Sets the JSON/CBOR object of an ArbData object by means of a JSON string.

dqcs_arb_len

Returns the number of unstructured arguments, or -1 to indicate failure.

dqcs_arb_new

Creates a new ArbData object.

dqcs_arb_pop

Pops an unstructured argument from the back of the list without returning it.

dqcs_arb_pop_raw

Pops an unstructured raw argument from the back of the list.

dqcs_arb_pop_str

Pops an unstructured string argument from the back of the list.

dqcs_arb_push_raw

Pushes an unstructured raw argument to the back of the list.

dqcs_arb_push_str

Pushes an unstructured string argument to the back of the list.

dqcs_arb_remove

Removes the specified unstructured string argument from the list.

dqcs_arb_set_raw

Replaces the unstructured argument at the specified index with the specified raw object.

dqcs_arb_set_str

Replaces the unstructured argument at the specified index with the specified string.

dqcs_cmd_iface_cmp

Compares the interface ID of an ArbCmd with the given string.

dqcs_cmd_iface_get

Returns the interface ID of an ArbCmd.

dqcs_cmd_new

Creates a new ArbCmd object.

dqcs_cmd_oper_cmp

Compares the operation ID of an ArbCmd with the given string.

dqcs_cmd_oper_get

Returns the operation ID of an ArbCmd.

dqcs_cq_len

Returns the number of ArbCmd objects in the given ArbCmd queue.

dqcs_cq_new

Creates a new ArbCmd queue object.

dqcs_cq_next

Advances an ArbCmd queue to the next command.

dqcs_cq_push

Pushes an ArbCmd object into the given ArbCmd queue.

dqcs_error_get

Returns a pointer to the latest error message.

dqcs_error_set

Sets the latest error message string.

dqcs_gate_controls

Returns a handle to a new qubit reference set containing the qubits that control this gate.

dqcs_gate_expand_control

Utility function that expands a gate matrix to account for all control qubits. >

dqcs_gate_has_controls

Returns whether the specified gate has control qubits.

dqcs_gate_has_matrix

Returns whether a unitary matrix is associated with this gate.

dqcs_gate_has_measures

Returns whether the specified gate measures any qubits.

dqcs_gate_has_name

Returns whether the specified gate has a name.

dqcs_gate_has_targets

Returns whether the specified gate has target qubits.

dqcs_gate_matrix

Returns a copy of the unitary matrix associated with this gate, if one exists.

dqcs_gate_measures

Returns a handle to a new qubit reference set containing the qubits measured by this gate.

dqcs_gate_name

Returns the name of a custom gate.

dqcs_gate_new_custom

Constructs a new custom gate.

dqcs_gate_new_measurement

Constructs a new measurement gate.

dqcs_gate_new_predef

Constructs a new predefined unitary gate.

dqcs_gate_new_predef_one

Constructs a new predefined unitary one-qubit gate.

dqcs_gate_new_predef_three

Constructs a new predefined unitary three-qubit gate.

dqcs_gate_new_predef_two

Constructs a new predefined unitary two-qubit gate.

dqcs_gate_new_prep

Constructs a new prep gate.

dqcs_gate_new_unitary

Constructs a new unitary gate.

dqcs_gate_reduce_control

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. >

dqcs_gate_targets

Returns a handle to a new qubit reference set containing the qubits targeted by this gate.

dqcs_gate_type

Returns the gate type of the given gate.

dqcs_gm_add_custom

Adds a fully customizable gate mapping to the given gate map. >

dqcs_gm_add_custom_unitary

Adds a custom unitary gate mapping to the given gate map. >

dqcs_gm_add_fixed_unitary

Adds a unitary gate mapping for the given gate matrix to the given gate map. >

dqcs_gm_add_measure

Adds a measurement gate mapping to the given gate map. >

dqcs_gm_add_predef_unitary

Adds a unitary gate mapping for the given DQCsim-defined gate to the given gate map. >

dqcs_gm_add_prep

Adds a prep gate mapping to the given gate map. >

dqcs_gm_construct

Uses a gate map object to construct a multi-qubit DQCsim gate from the plugin's representation. >

dqcs_gm_construct_one

Uses a gate map object to construct a one-qubit DQCsim gate from the plugin's representation. >

dqcs_gm_construct_three

Uses a gate map object to construct a three-qubit DQCsim gate from the plugin's representation. >

dqcs_gm_construct_two

Uses a gate map object to construct a two-qubit DQCsim gate from the plugin's representation. >

dqcs_gm_detect

Uses a gate map object to convert an incoming DQCsim gate to the plugin's representation. >

dqcs_gm_new

Constructs a new gate map. >

dqcs_handle_delete

Destroys the object associated with a handle.

dqcs_handle_delete_all

Deletes all handles for the current thread.

dqcs_handle_dump

Returns a debug dump of the object associated with the given handle.

dqcs_handle_leak_check

Succeeds only if there are no live handles in the current thread.

dqcs_handle_type

Returns the type of object associated with the given handle.

dqcs_log_raw

Primitive API for sending a log message using the current logger.

dqcs_mat_add_controls

Constructs a controlled matrix from the given matrix. >

dqcs_mat_approx_eq

Approximately compares two matrices. >

dqcs_mat_approx_unitary

Returns whether the matrix is approximately unitary. >

dqcs_mat_basis

Constructs a matrix with the eigenvectors of one of the Pauli matrices as column vectors. >

dqcs_mat_basis_approx_eq

Approximately compares two basis matrices. >

dqcs_mat_dimension

Returns the dimension (number of rows == number of columns) of the given matrix. >

dqcs_mat_get

Returns a copy of the contained matrix as a C array. >

dqcs_mat_is_predef

Returns whether this matrix is of the given predefined form and, if it is, any parameters needed to describe it. >

dqcs_mat_len

Returns the number of complex entries in the given matrix. >

dqcs_mat_new

Constructs a new gate matrix. >

dqcs_mat_num_qubits

Returns the number of qubits targeted by the given matrix. >

dqcs_mat_predef

Constructs a new gate matrix for one of DQCsim's predefined gates. >

dqcs_mat_strip_control

Splits a controlled matrix into its non-controlled submatrix and the indices of the control qubits. >

dqcs_meas_new

Constructs a new measurement object.

dqcs_meas_qubit_get

Returns the qubit reference associated with a measurement object.

dqcs_meas_qubit_set

Sets the qubit reference associated with a measurement object.

dqcs_meas_value_get

Returns the measurement value associated with a measurement object.

dqcs_meas_value_set

Sets the measurement value associated with a measurement object.

dqcs_mset_contains

Returns whether the given qubit measurement set contains data for the given qubit.

dqcs_mset_get

Returns a copy of the measurement result for the given qubit from a measurement result set.

dqcs_mset_len

Returns the number of qubits measurements in the given measurement set.

dqcs_mset_new

Creates a new set of qubit measurement results.

dqcs_mset_remove

Removes the measurement result for the given qubit from a measurement result set.

dqcs_mset_set

Adds a measurement result to a measurement result set.

dqcs_mset_take

Returns the measurement result for the given qubit from a measurement result set and removes it from the set.

dqcs_mset_take_any

Returns the measurement result for any of the qubits contained in a measurement result set and removes it from the set.

dqcs_pcfg_accept_timeout_get

Returns the configured timeout for the plugin process to connect to DQCsim.

dqcs_pcfg_accept_timeout_set

Configures the timeout for the plugin process to connect to DQCsim.

dqcs_pcfg_env_set

Overrides an environment variable for the plugin process.

dqcs_pcfg_env_unset

Removes/unsets an environment variable for the plugin process.

dqcs_pcfg_executable

Returns the configured executable path for the given plugin process.

dqcs_pcfg_init_cmd

Appends an ArbCmd to the list of initialization commands of a plugin process.

dqcs_pcfg_name

Returns the configured name for the given plugin process.

dqcs_pcfg_new

Creates a new plugin process configuration object using sugared syntax.

dqcs_pcfg_new_raw

Creates a new plugin process configuration object using raw paths.

dqcs_pcfg_script

Returns the configured script path for the given plugin process.

dqcs_pcfg_shutdown_timeout_get

Returns the configured timeout for the plugin process to shut down gracefully.

dqcs_pcfg_shutdown_timeout_set

Configures the timeout for the plugin process to shut down gracefully.

dqcs_pcfg_stderr_mode_get

Returns the configured stderr capture mode for the specified plugin process.

dqcs_pcfg_stderr_mode_set

Configures the capture mode for the stderr stream of the specified plugin process.

dqcs_pcfg_stdout_mode_get

Returns the configured stdout capture mode for the specified plugin process.

dqcs_pcfg_stdout_mode_set

Configures the capture mode for the stdout stream of the specified plugin process.

dqcs_pcfg_tee

Configures a plugin process to also output its log messages to a file.

dqcs_pcfg_type

Returns the type of the given plugin process configuration.

dqcs_pcfg_verbosity_get

Returns the configured verbosity for the given plugin process.

dqcs_pcfg_verbosity_set

Configures the logging verbosity for the given plugin process.

dqcs_pcfg_work_get

Returns the configured working directory for the given plugin process.

dqcs_pcfg_work_set

Overrides the working directory for the plugin process.

dqcs_pdef_author

Returns the plugin author for the given plugin definition object.

dqcs_pdef_name

Returns the plugin name for the given plugin definition object.

dqcs_pdef_new

Creates a new PluginDefinition object.

dqcs_pdef_set_advance_cb

Sets the callback for advancing time for operators and backends.

dqcs_pdef_set_allocate_cb

Sets the qubit allocation callback for operators and backends.

dqcs_pdef_set_drop_cb

Sets the user logic drop/cleanup callback.

dqcs_pdef_set_free_cb

Sets the qubit deallocation callback for operators and backends.

dqcs_pdef_set_gate_cb

Sets the gate execution callback for operators and backends.

dqcs_pdef_set_host_arb_cb

Sets the callback function function for handling an arb from the host.

dqcs_pdef_set_initialize_cb

Sets the user logic initialization callback.

dqcs_pdef_set_modify_measurement_cb

Sets the measurement modification callback for operators.

dqcs_pdef_set_run_cb

Sets the run callback for frontends.

dqcs_pdef_set_upstream_arb_cb

Sets the callback function for handling an arb from upstream for operators and backends.

dqcs_pdef_type

Returns the plugin type for the given plugin definition object.

dqcs_pdef_version

Returns the plugin version for the given plugin definition object.

dqcs_plugin_advance

Tells the downstream plugin to run for the specified number of cycles.

dqcs_plugin_allocate

Allocate the given number of downstream qubits.

dqcs_plugin_arb

Sends an arbitrary command downstream.

dqcs_plugin_free

Free the given downstream qubits.

dqcs_plugin_gate

Tells the downstream plugin to execute a gate.

dqcs_plugin_get_cycle

Returns the current value of the downstream cycle counter.

dqcs_plugin_get_cycles_between_measures

Returns the number of downstream cycles between the last two measurements of the given downstream qubit.

dqcs_plugin_get_cycles_since_measure

Returns the number of downstream cycles since the latest measurement of the given downstream qubit.

dqcs_plugin_get_measurement

Returns the latest measurement of the given downstream qubit.

dqcs_plugin_random_f64

Generates a random floating point number using the simulator random seed.

dqcs_plugin_random_u64

Generates a random unsigned 64-bit number using the simulator random seed.

dqcs_plugin_recv

Waits for a message from the host.

dqcs_plugin_run

Executes a plugin in the current thread.

dqcs_plugin_send

Sends a message to the host.

dqcs_plugin_start

Executes a plugin in a worker thread.

dqcs_plugin_wait

Waits for a plugin worker thread to finish executing.

dqcs_qbset_contains

Returns whether the given qubit set contains the given qubit.

dqcs_qbset_copy

Returns a copy of the given qubit set, intended for non-destructive iteration.

dqcs_qbset_len

Returns the number of qubits in the given set.

dqcs_qbset_new

Creates a new set of qubit references.

dqcs_qbset_pop

Pops a qubit reference off of a qubit reference set.

dqcs_qbset_push

Pushes a qubit reference into a qubit reference set.

dqcs_scfg_dqcsim_verbosity_get

Returns the configured verbosity for DQCsim's own messages.

dqcs_scfg_dqcsim_verbosity_set

Configures the logging verbosity for DQCsim's own messages.

dqcs_scfg_log_callback

Configures DQCsim to also output its log messages to callback function.

dqcs_scfg_new

Constructs an empty simulation configuration.

dqcs_scfg_push_plugin

Appends a plugin to a simulation configuration.

dqcs_scfg_repro_disable

Disables the reproduction logging system.

dqcs_scfg_repro_path_style_get

Returns the path style used when writing reproduction files.

dqcs_scfg_repro_path_style_set

Sets the path style used when writing reproduction files.

dqcs_scfg_seed_get

Returns the configured random seed.

dqcs_scfg_seed_set

Configures the random seed that the simulation should use.

dqcs_scfg_stderr_verbosity_get

Returns the configured stderr sink verbosity for a simulation.

dqcs_scfg_stderr_verbosity_set

Configures the stderr sink verbosity for a simulation.

dqcs_scfg_tee

Configures DQCsim to also output its log messages to a file.

dqcs_sim_arb

Sends an ArbCmd message to one of the plugins, referenced by name.

dqcs_sim_arb_idx

Sends an ArbCmd message to one of the plugins, referenced by index.

dqcs_sim_get_author

Queries the author of a plugin, referenced by instance name.

dqcs_sim_get_author_idx

Queries the author of a plugin, referenced by index.

dqcs_sim_get_name

Queries the implementation name of a plugin, referenced by instance name.

dqcs_sim_get_name_idx

Queries the implementation name of a plugin, referenced by index.

dqcs_sim_get_version

Queries the version of a plugin, referenced by instance name.

dqcs_sim_get_version_idx

Queries the version of a plugin, referenced by index.

dqcs_sim_new

Constructs a DQCsim simulation.

dqcs_sim_recv

Waits for the simulated accelerator to send a message to us.

dqcs_sim_send

Sends a message to the simulated accelerator.

dqcs_sim_start

Starts a program on the simulated accelerator.

dqcs_sim_wait

Waits for the simulated accelerator to finish its current program.

dqcs_sim_write_reproduction_file

Writes a reproduction file for the simulation so far.

dqcs_sim_yield

Yields to the simulator.

dqcs_tcfg_init_cmd

Appends an ArbCmd to the list of initialization commands of a plugin thread.

dqcs_tcfg_name

Returns the configured name for the given plugin thread.

dqcs_tcfg_new

Creates a new plugin thread configuration object from a plugin definition.

dqcs_tcfg_new_raw

Creates a new plugin thread configuration object from a callback.

dqcs_tcfg_tee

Configures a plugin thread to also output its log messages to a file.

dqcs_tcfg_type

Returns the type of the given plugin thread configuration.

dqcs_tcfg_verbosity_get

Returns the configured verbosity for the given plugin thread.

dqcs_tcfg_verbosity_set

Configures the logging verbosity for the given plugin thread.

Type Definitions

dqcs_cycle_t

Type for a simulation cycle timestamp.

dqcs_handle_t

Type for a handle.

dqcs_qubit_t

Type for a qubit reference.