Skip to content

Commit

Permalink
Format with black
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankya2 committed Jan 30, 2024
1 parent 827c285 commit 6181161
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/qibotn/cutn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def eval_tn_MPI(qibo_circ, datatype, n_samples=8):
The pathfinder looks at user defined number of samples (n_samples) iteratively to select the least costly contraction path. This is sped up with multi thread.
After pathfinding the optimal path is used in the actual contraction to give a dense vector representation of the TN.
"""

from mpi4py import MPI # this line initializes MPI
import socket
from cuquantum import Network
Expand Down Expand Up @@ -102,7 +102,7 @@ def eval_tn_MPI(qibo_circ, datatype, n_samples=8):

# Sum the partial contribution from each process on root.
result = comm.reduce(sendobj=result, op=MPI.SUM, root=root)

"""
path, opt_info = network.contract_path(optimize={"samples": n_samples, "threads": ncpu_threads, 'slicing': {'min_slices': max(16, size)}})
Expand Down Expand Up @@ -368,6 +368,7 @@ def eval_tn_MPI_expectation(qibo_circ, datatype, n_samples=8):

return result, rank


def eval_mps(qibo_circ, gate_algo, datatype):
myconvertor = QiboCircuitToMPS(qibo_circ, gate_algo, dtype=datatype)
mps_helper = MPSContractionHelper(myconvertor.num_qubits)
Expand All @@ -376,6 +377,7 @@ def eval_mps(qibo_circ, gate_algo, datatype):
myconvertor.mps_tensors, {"handle": myconvertor.handle}
)


def PauliStringGen(nqubits):
if nqubits <= 0:
return "Invalid input. N should be a positive integer."
Expand Down

0 comments on commit 6181161

Please sign in to comment.