# QuantumFunctionError

**URL:** <https://discuss.pennylane.ai/t/quantumfunctionerror/108>\
**Category:** PennyLane Help\
**Created:** [March 27, 2019, 8:43pm UTC](https://discuss.pennylane.ai/t/quantumfunctionerror/108 "2019-03-27T20:43:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![josh](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/josh/32/100_2.png) [@josh](https://discuss.pennylane.ai/u/josh)\
**Post date:** [March 28, 2019, 12:53am UTC](https://discuss.pennylane.ai/t/quantumfunctionerror/108/2 "2019-03-28T00:53:53Z")

</div>

Hi @EMY91,

In PennyLane, we support two main models of quantum computation:

- **Discrete variables**
  - This is the model simulated by `'default.qubit'`, as well as the [qiskit](https://github.com/carstenblank/pennylane-qiskit), [Forest](https://github.com/rigetti/pennylane-forest), and [ProjectQ](https://github.com/xanaduai/pennylane-pq) plugins.
  - This model supports specific operations and expectation values:  
_[Click here for a full list of discrete operations](https://pennylane.readthedocs.io/en/latest/code/ops/qubit.html)_  
_[Click here for a full list of discrete expectation values](https://pennylane.readthedocs.io/en/latest/code/expval/qubit.html)_

  

- **Continuous variables**
  - This is the model simulated by `'default.gaussian'`, as well as the [Strawberry Fields](https://github.com/xanaduai/pennylane-sf) plugin.
  - This model supports specific operations and expectation values:  
_[Click here for a full list of discrete operations](https://pennylane.readthedocs.io/en/latest/code/ops/qubit.html)_  
_[Click here for a full list of discrete expectation values](https://pennylane.readthedocs.io/en/latest/code/expval/qubit.html)_

  

There are several important things to note here:

- **You cannot mix continuous and discrete operations in the same QNode**.  
In your case, you are using `qml.Displacement` (a continuous operation) as well as `qml.RY` (a discrete operation) and `qml.expval.PauliZ` (a discrete expectation)

- **If the QNode device is a continuous device, you _must_ use only continuous operations. Likewise, if your QNode device is a discrete device, you _must_ use only discrete operations**.  
For example, `default.qubit` can use `qml.RY`, but not `qml.Displacement`.

I hope that helps, let me know if you have any other questions.

---

_[View the full topic](https://discuss.pennylane.ai/t/quantumfunctionerror/108)._
