PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
pennylane/qnodes/base.py:574: in evaluate
self.circuit.operations, self.circuit.observables, self.variable_deps
pennylane/_qubit_device.py:96: in execute
results.append(self.expval(obs))
pennylane/plugins/default_qubit.py:434: in expval
self.rotate_basis(observable)
pennylane/_qubit_device.py:160: in rotate_basis
self.apply(observable.diagonalizing_gates()[0])
pennylane/plugins/default_qubit.py:382: in apply
self._state = self.mat_vec_product(A, self._state, wires)
(...)
unused_idxs = [idx for idx in range(self.num_wires) if idx not in wires]
> perm = wires + unused_idxs
E TypeError: can only concatenate tuple (not "list") to tuple
pennylane/plugins/default_qubit.py:408: TypeError
Additional information
Any additional information, configuration or data that might be necessary
to reproduce the issue.
Issue description
When using
Hermitian
, if thewires
parameter is not specified as a list, an error seems to arise.Expected behavior: (What you expect to happen) Any type of
Sequence
to be accepted aswires
.Actual behavior: (What actually happens) If
tuple
is passed, there are certain cases when errors arise.Reproduces how often: (What percentage of the time does it reproduce?) Each time,
wires
is not defined as a list.System information: (post the output of
import pennylane as qml; qml.about()
)Source code and tracebacks
Specifying
wires
as a tuple as follows:Results in an error with the following traceback:
Additional information
Any additional information, configuration or data that might be necessary to reproduce the issue.