Skip to content

Commit

Permalink
apply default qubit state prep api change (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
antalszava committed Jan 26, 2021
1 parent 14b50f9 commit 5e5b7a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pennylane_lightning/lightning_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def apply(self, operations, rotations=None, **kwargs):
for i, operation in enumerate(operations): # State preparation is currently done in Python
if isinstance(operation, (QubitStateVector, BasisState)):
if i == 0:
self._apply_operation(operation)

if isinstance(operation, QubitStateVector):
self._apply_state_vector(operation.parameters[0], operation.wires)
else:
self._apply_basis_state(operation.parameters[0], operation.wires)

del operations[0]
else:
raise DeviceError(
Expand Down

0 comments on commit 5e5b7a7

Please sign in to comment.