6

Besides number of qubits, the devices can have other differences as well. The architecture of the device can be different, meaning that each device could have different connectivity maps. This would affect the mapping of valid multiqubit gates. They also can have different error rates at any given time. Calibrations are run on each device daily. These error ...


5

First of all, the name of backends (devices) have nothing to do with their location! They are all located in US. Back to your question, as others already mentioned the difference is in the architecture (topology), number of qubits, connectivity, and performance (influenced by various types of errors). If you click the name of any backend (device) in your ...


5

PennyLane supports measurements of tensor products of observable via the @ operator, like so: @qml.qnode(dev) def my_quantum_function(x, y): qml.RZ(x, wires=0) qml.CNOT(wires=[0, 1]) qml.RY(y, wires=1) return qml.expval(qml.PauliZ(0) @ qml.PauliZ(1)) This should return the same result as the solution by KAJ226 above, but will be slightly ...


5

Short, sort-of right answer: you can't This is in essence due to the superconducting qubits that e.g. IBM use being, well, qubits, while continuous variable (CV) operations don't act on qubits. Well, sort of. These are two fundamentally different ways of going about making a quantum computer, so let's start from first principles: When you take a state $\...


4

Here's a simple example if you're looking for a quick hack: import pennylane as qml import numpy as np def RXX(theta): rxx = np.array([ [np.cos(theta/2), 0, 0, -1j*np.sin(theta/2)], [0, np.cos(theta/2), -1j*np.sin(theta/2), 0], [0, -1j*np.sin(theta/2), np.cos(theta/2), 0], [-1j*np.sin(theta/2), 0, 0, np.cos(theta/2)] ]...


4

Maybe it is best to just work out the calculation step-by-step. First, let $U = R_y(\phi_2) R_x(\phi_1) $, and $|\psi \rangle = U|0\rangle$. The goal is to calculate $ \langle \psi| \sigma_z |\psi \rangle$ where $\sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$. Computing $|\psi \rangle$ explicitly. \begin{align} U|0 \rangle &= R_y(\...


4

Have a look at these for quantum machine learning: Supervised learning with quantum computers by Schuld and Petruccione (2018) An introduction to quantum machine learning by the same authors of the textbook above Quantum machine learning published in Nature 2017 by some experts in the field: Wittek, Rebentrost, Lloyd, et al Video presentations by Dr. Schuld ...


4

I think the following should work: n_qubits = 2 Z = [ [1,0], [0,-1]] ZZ = np.kron(Z,Z) @qml.qnode(dev) def circuit(params): qml.RY(params[0], wires=0) qml.CNOT(wires=[0, 1]) qml.RY(params[1], wires=1) return qml.expval(qml.Hermitian(ZZ, wires=[0, 1]))


3

The inherent uncertainty of QM is managed by making sure you're taking enough shots relative to the error bounds and probability of success for a given algorithm. If you don't have exact equations, and haven't done so already, just watching the extent to which your results convergence, or fail to converge, as you increase your shots, is a good first step. ...


3

I received a great answer to my question here, through the Xanadu Discussion Forum: I’d say that your approach of having a quantum function that depends on the number of wires, creating separate QNodes and devices is a good one. PennyLane doesn’t have any further conveniences for such a use case, other than creating a QNodeCollection which you’ve mentioned. ...


3

Simulator devices, like 'lightning.qubit' or 'default.qubit', can usually be run analytically. This is the default for most devices, but can be explicitly specified by setting shots=None. Devices inheriting from QubitDevice, like "default.qubit" and "lightning.qubit" currently rely on numpy.random for their random number generation. So ...


3

Yes, it is possible to do this with Qiskit and Cirq. For Qiskit, you can read up this tutorial page here. There was an answer by Josh Izaac from Pennylane here awhile back about parameter shift rule and finite difference to do gradient on quantum circuit here: https://quantumcomputing.stackexchange.com/a/15445/9858 For any quantum software platform, you can ...


2

In this tutorial in PennyLane, they guide you to create a custom gate (Rxx gate) https://pennylane.ai/blog/2021/05/how-to-add-custom-gates-and-templates-to-pennylane/ After creating it you can simply use these code to add it: dev = qml.device('default.qubit', wires=3) dev.operations.add("RXX")


2

Since quantum machine learning with NISQ hardware is such a relatively new field, it is still very highly research driven, and a lot of the potential is still being determined. To make these new research implementations more accessible, we've begun building implementations over at https://pennylane.ai/qml. Interesting ones include: Quantum Generative ...


2

Your expressions for $\langle X_0X_1 \rangle$ and $\langle Y_0Y_1 \rangle$ are correct under the assumption that the two qubits are independently random. In the case that they are correlated, these expressions will not yield the right answer. This is because you have to think of $X_0X_1$, for example, as an operator in its own right, rather than just a ...


Only top voted, non community-wiki answers of a minimum length are eligible