Skip to content

Commit 96129ea

Browse files
authored
Merge branch 'main' into fix/getting-started-ibmq-run-device
2 parents da6bfd8 + c12dc5a commit 96129ea

6 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎TKET_VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.102
1+
2.1.103

‎pytket/docs/changelog.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Fixes:
66

77
- Fix segfault in `LexiRouteRoutingMethod` (and so `DefaultMappingPass`) when
88
a `ClExprOp` is reached while looking ahead to the next two-qubit slice.
9+
- Fix out-of-bounds accesses in `LinePlacement` for circuits with no two-qubit
10+
interactions, and in Pauli partitioning with no terms.
911

1012
## 2.18.4 (September 2026)
1113

‎tket/src/Architecture/Architecture.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ static bool lexicographical_comparison(
112112

113113
std::optional<Node> Architecture::find_worst_node(
114114
const Architecture& original_arch) {
115+
if (n_nodes() == 0) {
116+
return std::nullopt;
117+
}
115118
node_set_t ap = get_articulation_points();
116119
node_set_t min_nodes = min_degree_nodes();
117120

‎tket/src/Diagonalisation/PauliPartition.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ get_partitioned_paulis_for_largest_first_method(const PauliACGraph& pac_graph) {
167167
unsigned*,
168168
boost::property_map<PauliACGraph, boost::vertex_index_t>::const_type>
169169
colour_prop_map(
170-
&colour_vec.front(), boost::get(boost::vertex_index, pac_graph));
170+
colour_vec.data(), boost::get(boost::vertex_index, pac_graph));
171171
boost::sequential_vertex_coloring(
172172
pac_graph,
173173
boost::make_iterator_property_map(

‎tket/test/src/Placement/test_LinePlacement.cpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ SCENARIO("LinePlacement class") {
2424
REQUIRE_THROWS_AS(LinePlacement(architecture), std::logic_error);
2525
}
2626

27-
// https://github.com/Quantinuum/tket/issues/2199
28-
#ifdef NDEBUG
2927
GIVEN("Empty circuit, two qubit Architecture, LinePlacement::Place.") {
3028
std::vector<std::pair<unsigned, unsigned>> edges = {{0, 1}};
3129
Architecture architecture(edges);
@@ -34,7 +32,6 @@ SCENARIO("LinePlacement class") {
3432
placement.place(circuit);
3533
REQUIRE(circuit.n_qubits() == 0);
3634
}
37-
#endif
3835

3936
GIVEN("Single qubit circuit, two qubit Architecture, LinePlacement::Place") {
4037
std::vector<std::pair<unsigned, unsigned>> edges = {{0, 1}};

‎tket/test/src/test_Partition.cpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ SCENARIO("Small sets of Gadgets are partitioned correctly") {
3232
GraphColourMethod::LargestFirst, GraphColourMethod::Exhaustive,
3333
GraphColourMethod::Lazy};
3434

35-
// https://github.com/Quantinuum/tket/issues/2199
36-
#ifdef NDEBUG
3735
GIVEN("No gadgets") {
3836
for (auto colouring_method : colouring_methods) {
3937
for (PauliPartitionStrat strat : strats) {
@@ -44,7 +42,6 @@ SCENARIO("Small sets of Gadgets are partitioned correctly") {
4442
}
4543
}
4644
}
47-
#endif
4845

4946
GIVEN("Two anti-commuting gadgets") {
5047
/* We know the correct order, as QubitOperator orders

0 commit comments

Comments
 (0)