my_tensors_from_classical_action#
View source on GitHub
|
Returns the quimb tensors for the bloq derived from its on_classical_vals method.
qualtran.simulation.tensor.my_tensors_from_classical_action(
bloq: 'Bloq',
incoming: dict[str, 'ConnectionT'],
outgoing: dict[str, 'ConnectionT']
) -> list['qtn.Tensor']
This function has the same signature as bloq.my_tensors, and can be used as a
replacement for it when the bloq has a known classical action.
For example:
class ClassicalBloq(Bloq):
...
def on_classical_vals(...):
...
def my_tensors(self, incoming, outgoing):
return my_tensors_from_classical_action(self, incoming, outgoing)
View source on GitHub