Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ IX = "IX"
IZ = "IZ"
XY = "XY"
canonicalizer = "canonicalizer"
mch = "mch"
MCH = "MCH"
paeth = "paeth"
pngs = "pngs"
PNGs = "PNGs"

[default.extend-identifiers]
PNGs = "PNGs"
83 changes: 32 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ strip = true
approx = { version = "0.5", features = ["num-complex"] }
bitvec = "1.0.1"
cbindgen = "0.29.2"
faer = "0.24.0"
faer = "0.24"
lalrpop = "0.22"
lalrpop-util = "0.22"
lazy_static = "1.5.0"
indexmap = "2.12"
ndarray = { version = "0.17", features = ["approx", "rayon"] }
num = "0.4"
numpy = "0.27"
numpy = "0.29"
num-complex = "0.4"
oq3_semantics = "0.7.0"
rayon = "1.11.0"
Expand Down
13 changes: 8 additions & 5 deletions crates/binding-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ add_dependencies(cqlib_c_example cargo_build_binding_c)
target_include_directories(cqlib_c_example PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(cqlib_c_example PRIVATE ${RUST_LIB})

if(UNIX)
if(APPLE)
enable_language(CXX)
set_target_properties(cqlib_c_example PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(cqlib_c_example PRIVATE c++ "-framework CoreFoundation")
endif()

if(UNIX AND NOT APPLE)
target_link_libraries(cqlib_c_example PRIVATE pthread dl m)
if(APPLE)
target_link_libraries(cqlib_c_example PRIVATE "-framework CoreFoundation")
endif()
endif()

if(WIN32)
target_link_libraries(cqlib_c_example PRIVATE ws2_32 userenv advapi32 bcrypt)
target_link_libraries(cqlib_c_example PRIVATE ntdll ws2_32 bcrypt userenv advapi32)
endif()
2 changes: 1 addition & 1 deletion crates/binding-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "_native"
crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = { version = "0.27", features = ["abi3-py310", "num-complex", "chrono"] }
pyo3 = { version = "0.29", features = ["abi3-py310", "num-complex", "chrono"] }
chrono = "0.4"
cqlib-core = { path = "../cqlib-core", version = '0.1.0' }
num-complex.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/binding-python/cqlib/circuit/gates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
The ``cqlib.circuit.gates`` submodule provides gate type classes
(:class:`StandardGate`, :class:`UnitaryGate`, :class:`MCGate`,
:class:`CircuitGate`, :class:`Directive`, :class:`FrozenCircuit`) and
33 pre-built standard-gate singleton constants (``H``, ``X``, ``CX``,
``RX``, ``RX``, etc.) for use with
36 pre-built standard-gate singleton constants (``H``, ``X``, ``CX``,
``RX``, ``RZ``, etc.) for use with
:meth:`Circuit.append_gate <cqlib.circuit.Circuit.append_gate>`
and :meth:`Circuit.append_unitary_gate
<cqlib.circuit.Circuit.append_unitary_gate>`.
Expand Down
36 changes: 30 additions & 6 deletions crates/binding-python/src/circuit/ansatz/feature_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ use super::two_local::PyEntanglementTopology;
/// >>> circuit = ae.build_circuit("x")
/// >>> ae.num_parameters()
/// 4
#[pyclass(name = "AngleEncoding", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "AngleEncoding",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyAngleEncoding {
pub(crate) inner: AngleEncoding,
Expand Down Expand Up @@ -133,7 +137,11 @@ impl PyAngleEncoding {
}

/// Computational basis encoding from a bitstring.
#[pyclass(name = "BasisEncoding", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "BasisEncoding",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyBasisEncoding {
pub(crate) inner: BasisEncoding,
Expand Down Expand Up @@ -204,7 +212,11 @@ impl PyBasisEncoding {
}

/// A first-order Z feature map without entanglement.
#[pyclass(name = "ZFeatureMap", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "ZFeatureMap",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyZFeatureMap {
pub(crate) inner: ZFeatureMap,
Expand Down Expand Up @@ -286,7 +298,11 @@ impl PyZFeatureMap {
}

/// An IQP-style diagonal feature map.
#[pyclass(name = "IQPFeatureMap", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "IQPFeatureMap",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyIQPFeatureMap {
pub(crate) inner: IQPFeatureMap,
Expand Down Expand Up @@ -392,7 +408,11 @@ impl PyIQPFeatureMap {
/// >>> circuit = fm.build_circuit("x")
/// >>> fm.num_parameters()
/// 3
#[pyclass(name = "ZZFeatureMap", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "ZZFeatureMap",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyZZFeatureMap {
pub(crate) inner: ZZFeatureMap,
Expand Down Expand Up @@ -532,7 +552,11 @@ impl PyZZFeatureMap {
/// ... .paulis([PauliString.from_str("Z"), PauliString.from_str("ZZ")])
/// ... .entanglement(EntanglementTopology.full()))
/// >>> circuit = fm.build_circuit("x")
#[pyclass(name = "PauliFeatureMap", module = "cqlib.circuit.ansatz")]
#[pyclass(
name = "PauliFeatureMap",
module = "cqlib.circuit.ansatz",
skip_from_py_object
)]
#[derive(Clone)]
pub struct PyPauliFeatureMap {
pub(crate) inner: PauliFeatureMap,
Expand Down
Loading
Loading