Skip to content

Commit

Permalink
update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
MauroMendizabal committed Jan 23, 2025
1 parent 0033d72 commit f08dd95
Show file tree
Hide file tree
Showing 3 changed files with 673 additions and 653 deletions.
16 changes: 8 additions & 8 deletions emu_sv/custom_callback_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ def correlation_matrix_sv_impl(
num_qubits = int(math.log2(len(state.vector)))
state_tensor = state.vector.reshape((2,) * num_qubits)

correlation_matrix = [[0.0]*num_qubits for _ in range(num_qubits)]
correlation_matrix = [[0.0] * num_qubits for _ in range(num_qubits)]

for numi in range(num_qubits):
select_i = state_tensor.select(numi, 1)
for numj in range(numi, num_qubits): # select the upper triangle
for numj in range(numi, num_qubits): # select the upper triangle
if numi == numj:
value = (select_i.norm()**2).item()
else:
value = (select_i.select(numj-1 ,1).norm()**2).item()
value = (select_i.norm() ** 2).item()
else:
value = (select_i.select(numj - 1, 1).norm() ** 2).item()

correlation_matrix[numi][numj]=value
correlation_matrix[numj][numi]=value
correlation_matrix[numi][numj] = value
correlation_matrix[numj][numi] = value
return correlation_matrix


Expand Down
645 changes: 0 additions & 645 deletions examples/emu_sv_examples/examples/emu_sv_getting_started.ipynb

This file was deleted.

Loading

0 comments on commit f08dd95

Please sign in to comment.