Skip to content

Commit

Permalink
use both cutoff in eswap
Browse files Browse the repository at this point in the history
  • Loading branch information
tjstavenger-pnnl committed Oct 12, 2023
1 parent ceec20f commit 968f744
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions c2qa/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,10 @@ def eswap(self, theta, cutoff_a, cutoff_b):
csc_matrix: operator matrix
"""

# FIXME which cutoff values to use
self.mat = numpy.zeros([cutoff_a * cutoff_a, cutoff_a * cutoff_a])
self.mat = numpy.zeros([cutoff_a * cutoff_b, cutoff_a * cutoff_b])
for j in range(cutoff_a):
for i in range(cutoff_a):
self.mat[i + (j * cutoff_a)][i * cutoff_a + j] = 1
for i in range(cutoff_b):
self.mat[i + (j * cutoff_a)][i * cutoff_b + j] = 1
self.sparse_mat = scipy.sparse.csr_matrix(self.mat).tocsc()

arg = 1j * theta * self.sparse_mat
Expand Down

0 comments on commit 968f744

Please sign in to comment.