-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathlib.rs
More file actions
40 lines (36 loc) · 1.38 KB
/
lib.rs
File metadata and controls
40 lines (36 loc) · 1.38 KB
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
// This code is part of Qiskit.
//
// (C) Copyright IBM 2025
//
// This code is licensed under the Apache License, Version 2.0. You may
// obtain a copy of this license in the LICENSE.txt file in the root directory
// of this source tree or at https://www.apache.org/licenses/LICENSE-2.0.
//
// Any modifications or derivative works of this code must retain this
// copyright notice, and modified files need to carry a notice indicating
// that they have been altered from the originals.
use pyo3::import_exception;
use pyo3::prelude::*;
use pyo3::types::PyModule;
use pyo3::{Bound, PyResult, wrap_pyfunction};
mod annotations;
mod bytes;
mod circuit_reader;
mod circuit_writer;
mod consts;
mod expr;
mod formats;
mod params;
mod py_methods;
mod value;
/// Internal module supplying the QPY capabilities. The entries in it should largely
/// be re-exposed directly to public Python space.
pub fn qpy(module: &Bound<PyModule>) -> PyResult<()> {
module.add_function(wrap_pyfunction!(circuit_writer::py_write_circuit, module)?)?;
module.add_function(wrap_pyfunction!(circuit_reader::py_read_circuit, module)?)?;
module.add_function(wrap_pyfunction!(value::py_write_values, module)?)?;
module.add_function(wrap_pyfunction!(value::py_read_values, module)?)?;
Ok(())
}
import_exception!(qiskit.qpy.exceptions, UnsupportedFeatureForVersion);
import_exception!(qiskit.qpy.exceptions, QpyError);