1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! This module provides a C interface to the DQCsim simulator.
//!
//! Refer to [the generated API docs](https://mbrobbel.github.io/dqcsim/c-api/c-api.apigen.html)
//! for more information.
use *;
use crate::;
use *;
use Complex64;
use ;
// Module containing type definitions shared between rust and C.
pub use *;
// Module containing all the external functions exposed to the library user.
pub use *;
// Module containing the thread-local API state object. This object owns all
// the objects that are directly manipulable by the API and are not otherwise
// owned by any DQCsim instance.
use *;
// Module containing the thread-local state of whatever DQCsim structure is
// being represented by the API user, which may be one of the following or
// nothing:
// - an "accelerator" a.k.a. a DQCsim simulation;
// - a frontend plugin;
// - an operator plugin;
// - a backend plugin;
// Even when none of those things is active, API functions operating only on
// the API_STATE object will still work just fine, and are in fact needed to
// initialize the above four things.
//
// The reason for the separation between the API and DQCsim state has to do
// with the fact that objects owned by the DQCsim state are allowed to call
// back into the user code, which is in turn allowed to modify the API state.
// That is, DQCSIM_STATE owns closures that may take a mutable reference to
// API_STATE. Unless we move the closures out of DQCSIM_STATE before calling
// them, this necessarily means that API_STATE and DQCSIM_STATE cannot be
// contained by the same RefCell. Hence the need for them to be separated.
//
// Note that the above means that user callback functions are NOT allowed to
// call any API function that takes a reference to DQCSIM_STATE. Fortunately,
// there is (currently!) no need for them to ever do that.
//mod dqcsim_state;
//use dqcsim_state::*;
// Module containing utility functions and auxiliary data structures.
use *;