Skip to content

Commit

Permalink
Update to 0.2.0
Browse files Browse the repository at this point in the history
The changes put in so far are enough breakage to warrant a version increase.

Also increase QAOA available qubits for Qiskit simulation.
  • Loading branch information
chemix-lunacy committed Jan 6, 2025
1 parent 7cadcab commit a5d9221
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def fetch_runner(qubit_count, tracing_runner=False):
precisely what's going on. It's only used for visualization though, so will be a little slower.
"""
if tracing_runner:
return RasqalRunner(TracingRuntime(qubit_count=qubit_count))
return RasqalRunner(TracingRuntime(qubit_count))
else:
return fetch_qasm_runner(qubit_count)

Expand Down Expand Up @@ -193,7 +193,7 @@ def qaoa():
to evolve them.
"""
print("Running qaoa.")
runner = fetch_runner(20)
runner = fetch_runner(30)
runner.run_ll(read_qir_file("qaoa.ll"))


Expand Down
2 changes: 1 addition & 1 deletion src/rasqal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["John Dumbell"]
name = "rasqal"
version = "0.1.7"
version = "0.2.0"
edition = "2021"
license = "BSD-3-Clause"
description = ""
Expand Down
2 changes: 1 addition & 1 deletion src/rasqal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rasqal"
version = "0.1.7"
version = "0.2.0"
requires-python = ">=3.10"
description = "A hybrid quantum-classical analysis/solving runtime."
license = { file = "LICENSE" }
Expand Down
8 changes: 6 additions & 2 deletions src/rasqal/rasqal/simulators.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024 Oxford Quantum Circuits Ltd
from copy import copy

from typing import Dict

from qiskit import QiskitError, QuantumCircuit, transpile
from qiskit_aer import AerSimulator
from qiskit_aer.backends import AerSimulator
from qiskit_aer.backends.backendconfiguration import AerBackendConfiguration

from .runtime import RasqalRunner
from .adaptors import BuilderAdaptor, RuntimeAdaptor
Expand Down Expand Up @@ -69,7 +71,9 @@ def __init__(self, qubit_count=30):
self.qubit_count = qubit_count

def execute(self, builder: QASMBuilder) -> Dict[str, int]:
qasm_sim = AerSimulator()
config = copy(AerSimulator._DEFAULT_CONFIGURATION)
config["n_qubits"] = self.qubit_count
qasm_sim = AerSimulator(configuration=AerBackendConfiguration.from_dict(config))

circuit = builder.circuit
try:
Expand Down
7 changes: 3 additions & 4 deletions src/rasqal/src/analysis/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Tangle {
}
}

/// Solved entanglement metadata between qubits. Holds teh ratio of entanglement and with what
/// Solved entanglement metadata between qubits. Holds the ratio of entanglement and with what
/// qubit, optionally if the resultant entanglement is inferred by another entanglement.
///
/// This means if you have Q0~Q1~Q2 any entanglement information for Q0 about Q2 will be via Q1.
Expand Down Expand Up @@ -1296,7 +1296,7 @@ pub struct ResultFragment {

/// Max number of qubits that are actually measured. Indexes do not need to be sequential, so
/// you can measure qubits 5, 75, 240 and 700 and this will simply be 4. Used to pad out
/// unknowable values if a qubit is early in the analysis chain.
/// unknowable values if a qubit is early in the analysis chain.
measureable_qubits: Ptr<HashSet<i64>>
}

Expand Down Expand Up @@ -1457,7 +1457,7 @@ impl ResultsSynthsizer {

for ent_meta in entanglements.iter() {
// Since we're sorted on this, soon as we see a non-one hundred value we know there
// will be no others. Ratio is 0-100.
// will be no others. Ratio is 0.0 to 1.0.
if !is_near!(ent_meta.ratio, 1.0) {
break;
}
Expand All @@ -1466,7 +1466,6 @@ impl ResultsSynthsizer {
removals.insert(ent_meta.qubit);
}

let number_of_entanglements = entanglements.len();
let mut results = Vec::new();
results.push(ResultFragment::with_flipped(&starter));
results.push(starter);
Expand Down

0 comments on commit a5d9221

Please sign in to comment.