-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Optimize matrices multiplication, tensors multiplication. The optimization allows to speed up essential circuit calculations. Please be familiar with TensorNetwork framework.
`def get_state_vector(self):
"""
Returns resulting state vector as a tensor of rank 1.
Round values to 3 decimal points.
"""
# connect all nodes and evaluate all tensors stored in it
self.evaluate_patch()
if len(self.network) > 1:
for index in reversed(range(1, len(self.network) - 1)):
self.network[index + 1][0] ^ self.network[index][1]
self.network[1][0] ^ self.network[0][0]
nodes = tn.reachable(self.network[1])
result = tn.contractors.greedy(nodes, ignore_edge_order=True)
# round the result to three decimals
state_vecor = np.round(result.tensor, 3)
return state_vecor`
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed