Skip to content

Commit

Permalink
use zip (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung authored Oct 10, 2024
1 parent ed5480a commit eaeab61
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qiskit_addon_dice_solver/dice_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,12 @@ def _construct_ci_vec_from_addresses_amplitudes(

addr_map = {uni_addr: i for i, uni_addr in enumerate(uniques)}

for idx, address in enumerate(addresses):
address_a = address[0]
address_b = address[1]

for amp, address in zip(amps, addresses):
address_a, address_b = address
i = addr_map[address_a]
j = addr_map[address_b]
ci_vec[i, j] = amps[idx]

ci_vec[i, j] = amp

addresses_a[i] = uniques[i]
addresses_b[j] = uniques[j]
Expand Down

0 comments on commit eaeab61

Please sign in to comment.