Questions tagged [pennylane]

PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.

96 questions
10
votes
2 answers

What are the benefits of using quantum machine learning?

I have been investigating uses for quantum machine learning, and have made a few working examples (variations of variational quantum classifiers using PennyLane). However, my issue now is its relationship with classical machine learning. At the…
8
votes
3 answers

What are the differences between the IBM machines?

I'm quite new to this field, and have started sending jobs to IBM's quantum computers. I have access to around 11 locations. I can see that these have different numbers of qubits within them, and then different layouts of them as well. I am trying…
7
votes
3 answers

Pennylane and Qiskit for quantum machine learning

I'm interested in quantum computing, specifically in “quantum machine learning” (QML). I'm going to start my masters program in computer science and have previous experience in classical machine learning. I'd like to learn quantum mechanics…
7
votes
1 answer

How linear combination of unitaries gradient work (Qiskit, PennyLane)?

I'm trying to implement linear combination of unitaries(LCU) gradient from Qiskit Gradient Framework but on PennyLane. First, i looked through the source code in Qiskit. In Qiskit LCU gradient if we have 2 parameterized gate and 2 hamiltonian terms…
5
votes
1 answer

Pennylane: creating QNodes for large numbers of circuits that only differ by number of wires

Take the following simple quantum function: def my_quantum_function(params, wires=None): for i in range(wires): random_rot = params[i] qml.RY(random_rot, wires=i) qml.broadcast(qml.CZ, wires=range(wires),…
ryanhill1
  • 2,668
  • 1
  • 11
  • 39
4
votes
0 answers

What is the most efficient method to update the binary encoded values inside a quantum state?

We're implementing a QML algorithm in which we have to update the value stored inside a quantum state which is strictly unknown to us, by multiplying it with a real number classically stored with us. One approach is to binary encode the real number…
4
votes
1 answer

Implementation of Unitary in Shor's Algorithm in PennyLane

I've been working on implementing Shor's Algorithm in PennyLane, but am struggling to understand how the circuit for 'U' has been constructed according to Qiskit. In the Qiskit textbook, they seek to factor 15, which, for my own sake, is what I…
Ella Ceroni
  • 105
  • 4
4
votes
1 answer

How can I write unit tests for a pennylane circuit?

I have several mixing unitary circuits written using Pennylane to be used in the QAOA algorithm. Furthermore, I'd like to write unit tests for these mixing circuits to ensure that the code is doing what it is supposed to in the future as changes are…
Faiyaz Hasan
  • 400
  • 2
  • 12
4
votes
1 answer

Differentiable Programming of Quantum Computers

Recently, I have tried PennyLane and TensorFlow Quantum. These platforms are said to provide differentiable programming of quantum computers but I can't understand it clearly though. I have searched about differentiable programming and found out…
4
votes
2 answers

How to create the equivalent of the Qiskit rxx gate in Pennylane?

How can I create the Pennylane equivalent of: from qiskit import QuantumCircuit circ = QuantumCircuit(2, 2) circ.rxx(theta=0.3, qubit1=0, qubit2=1)
Faiyaz Hasan
  • 400
  • 2
  • 12
4
votes
2 answers

Computing expectation value of product of observables in PennyLane

In PennyLane, the following circuit returns the expectation value of the PauliZ observable on qubit (wire) 1: def my_quantum_function(x, y): qml.RZ(x, wires=0) qml.CNOT(wires=[0, 1]) qml.RY(y, wires=1) return…
3
votes
1 answer

PennyLane operations - Kerr, Displacement and Squeeze

I am familiar with the quantum gates of Qiskit, but I become very confused when looking at the continuous variable (CV) operations in the PennyLane documentation. I am especially interested in the Karr, Squeeze and Displacement operators as I have…
QCQCQC
  • 449
  • 3
  • 10
3
votes
1 answer

Expected value of a product of the Pauli matrices in different bases

I'm trying to reproduce the results of this article https://arxiv.org/abs/1801.03897, using Qiskit and Xanadu PennyLane. Particularly, this part with expected values of the Pauli operators: For Ansatz circuit from the mentioned article I can get…
C-Roux
  • 948
  • 2
  • 9
  • 20
3
votes
1 answer

VarQITE from scratch: troubles understanding the Variational Quantum Time Evolution (VarQTE) algorithm from Qiskit

At the moment I am trying to implement variational imaginary time evolution in Pennylane from scratch. To get a feeling if it works, I compare the results of my own implementation with the solutions of the VarQITE class of Qiskit. I implemented all…
3
votes
0 answers

Post-selection on pennylane

I want to do something like this: For a single-qubit Apply Hadamard -> Time_evolution -> Phase_damping -> Hadamard -> Post-selection -> Get CFI(classical fisher info) Density matrix after Phase_damping is: (You can see the e^-t added at the…
Donguk kim
  • 115
  • 5
1
2 3 4 5 6 7