I run this tensor networks:
dev_1 = qml.device("default.qubit", wires=8)
@qml.qnode(dev_1)
def ASNet(template_weights):
qml.TTN(
wires=range(8),
n_block_wires=2,
block=ASymmetricDNAEncoder,
n_params_block=9,
template_weights=template_weights)
for i in range(7):
qml.CNOT(wires = [i,7])
qml.CNOT(wires = [7,i])
return qml.state()
This is the printed error: Traceback (most recent call last):
File "/Users/namnguyen/Documents/Research/PhD/EtaNET_V3/clean_code/embeddings/encode.py", line 51, in <module>
print(ASNet(w_as))
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/qnode.py", line 585, in __call__
**self.execute_kwargs,
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/interfaces/batch/__init__.py", line 342, in execute
cache_execute(batch_execute, cache, return_tuple=False, expand_fn=expand_fn)(tapes)
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/interfaces/batch/__init__.py", line 173, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/interfaces/batch/__init__.py", line 124, in fn
tapes = [expand_fn(tape) for tape in tapes]
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/interfaces/batch/__init__.py", line 124, in <listcomp>
tapes = [expand_fn(tape) for tape in tapes]
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/interfaces/batch/__init__.py", line 325, in <lambda>
expand_fn = lambda tape: device.expand_fn(tape, max_expansion=max_expansion)
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/_device.py", line 658, in expand_fn
return self.default_expand_fn(circuit, max_expansion=max_expansion)
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/_device.py", line 633, in default_expand_fn
circuit = circuit.expand(depth=max_expansion, stop_at=self.stopping_condition)
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/tape/tape.py", line 567, in expand
self, depth=depth, stop_at=stop_at, expand_measurements=expand_measurements
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/tape/tape.py", line 198, in expand_tape
obj = obj.expand()
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/operation.py", line 1108, in expand
self.decomposition()
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/operation.py", line 1002, in decomposition
*self.parameters, wires=self.wires, **self.hyperparameters
File "/Users/namnguyen/opt/anaconda3/envs/quanonco/lib/python3.7/site-packages/pennylane/templates/tensornetworks/ttn.py", line 214, in compute_decomposition
if block.__code__.co_argcount > 2:
AttributeError: 'QNode' object has no attribute '__code__'
Please help
Thanks alot!