Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using both struqture 1.0 and 2.0 in noise models #551

Merged
merged 16 commits into from
Jul 24, 2024
Merged
129 changes: 82 additions & 47 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion qoqo-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ doctest = false
proc-macro2 = "1.0"
syn = { version = "2.0", features = ["full", "visit"] }
quote = "1.0"
struqture = { version = "~1.8" }
struqture = { version = "~1.9" }

[features]
unstable_chain_with_environment = []
4 changes: 2 additions & 2 deletions qoqo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ roqoqo = { version = "~1.15", path = "../roqoqo", features = [
"serialize",
"overrotate",
] }
struqture = { version = "~1.8" }
struqture-py = { version = "~1.8", default-features = false }
struqture = { version = "~1.9" }
struqture-py = { version = "~1.9", default-features = false, features=["unstable_struqture_2_import"] }
numpy = "0.21"
bincode = "1.3"
serde_json = "1.0"
Expand Down
13 changes: 13 additions & 0 deletions qoqo/python_tests/test_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import sys
from qoqo import operations as ops
from qoqo import Circuit
import struqture_py


@pytest.mark.parametrize(
Expand Down Expand Up @@ -45,5 +46,17 @@ def test_circuit(measurement):
assert len(circuit) > 0


# def test_struqture_2_0():
# """Testing the new 2.0 struqture serialisation."""
# hamiltonian = struqture_py.spins.SpinHamiltonianSystem()
# hamiltonian.add_operator_product(struqture_py.spins.PauliProduct().z(0).x(2), 1.0)
# hamiltonian.add_operator_product("1Z", 2.0)

# circuit = Circuit()
# circuit += ops.ApplyConstantSpinHamiltonian(hamiltonian, 5.0)
# circuit += ops.ApplyTimeDependentSpinHamiltonian(hamiltonian, [2.0], {"omega": [1.0]})
# assert len(circuit) > 0


kbarkhqs marked this conversation as resolved.
Show resolved Hide resolved
if __name__ == "__main__":
pytest.main(sys.argv)
Loading
Loading