Skip to content

Commit 038a10f

Browse files
authored
Merge branch 'main' into generic
2 parents dd4fa5d + c149735 commit 038a10f

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v1.102.5 (2025-10-03)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* ensure gate_matrix dtype is complex for unitary matrices
8+
39
## v1.102.4 (2025-09-19)
410

511
### Bug Fixes and Other Changes

src/braket/_sdk/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
Version number (major.minor.patch[-label])
1616
"""
1717

18-
__version__ = "1.102.5.dev0"
18+
__version__ = "1.102.6.dev0"

src/braket/aws/aws_device.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from braket.device_schema.pulse.pulse_device_action_properties_v1 import PulseDeviceActionProperties
3232
from braket.ir.openqasm import ProgramSet as OpenQASMProgramSet
3333
from braket.schema_common import BraketSchemaBase
34-
from networkx import DiGraph, complete_graph, from_edgelist
34+
from networkx import DiGraph, complete_graph, from_dict_of_lists, from_edgelist, relabel_nodes
3535

3636
from braket.aws.aws_quantum_task import AwsQuantumTask
3737
from braket.aws.aws_quantum_task_batch import AwsQuantumTaskBatch
@@ -520,12 +520,10 @@ def _construct_topology_graph(self) -> DiGraph:
520520
return complete_graph(
521521
int(self.properties.paradigm.qubitCount), create_using=DiGraph()
522522
)
523-
adjacency_lists = self.properties.paradigm.connectivity.connectivityGraph
524-
edges = []
525-
for item in adjacency_lists.items():
526-
i = item[0]
527-
edges.extend([(int(i), int(j)) for j in item[1]])
528-
return from_edgelist(edges, create_using=DiGraph())
523+
g = from_dict_of_lists(
524+
self.properties.paradigm.connectivity.connectivityGraph, create_using=DiGraph()
525+
)
526+
return relabel_nodes(g, {n: int(n) for n in g.nodes})
529527
if hasattr(self.properties, "provider") and isinstance(
530528
self.properties.provider, DwaveProviderProperties
531529
):

src/braket/circuits/unitary_calculation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def calculate_unitary_big_endian(
6767
else:
6868
gate_matrix = fractional_matrix_power(base_gate_matrix, instruction.power)
6969

70+
gate_matrix = np.asarray(gate_matrix, dtype=complex)
71+
7072
unitary = multiply_matrix(
7173
unitary,
7274
gate_matrix,

0 commit comments

Comments
 (0)