Black formate
This commit is contained in:
@@ -12,7 +12,6 @@ def eval(qibo_circ, datatype):
|
||||
|
||||
|
||||
def eval_tn_MPI(qibo_circ, datatype):
|
||||
|
||||
ncpu_threads = multiprocessing.cpu_count() // 2
|
||||
n_samples = 8
|
||||
|
||||
@@ -30,7 +29,9 @@ def eval_tn_MPI(qibo_circ, datatype):
|
||||
operands_interleave = myconvertor.state_vector_operands()
|
||||
|
||||
network = cutn.Network(*operands_interleave, options=network_opts)
|
||||
network.contract_path(optimize={'samples': n_samples, 'threads': ncpu_threads}) # Calculate optimal path, returns path and info
|
||||
network.contract_path(
|
||||
optimize={"samples": n_samples, "threads": ncpu_threads}
|
||||
) # Calculate optimal path, returns path and info
|
||||
|
||||
result = network.contract()
|
||||
|
||||
@@ -41,16 +42,15 @@ def eval_tn_MPI(qibo_circ, datatype):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from qibo.models import QFT
|
||||
import cupy as cp
|
||||
import numpy as np
|
||||
|
||||
num_qubits = 10
|
||||
num_qubits = 10
|
||||
swaps = True
|
||||
circ_qibo = QFT(num_qubits, swaps)
|
||||
|
||||
dtype="complex128"
|
||||
dtype = "complex128"
|
||||
sv_mpi, rank = eval_tn_MPI(circ_qibo, dtype)
|
||||
|
||||
if rank == 0:
|
||||
|
||||
Reference in New Issue
Block a user