Questions tagged [pennylane]

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

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
97 views

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. ...
Rohan Bhatia's user avatar
3 votes
1 answer
424 views

QUBO defined in Qiskit/DOcplex: how to solve it using Pennylane?

I have a complex Integer Linear Programming model defined in DOcplex/Qiskit representing a combinatorial optimization problem. Using the Qiskit utils, it is possible to covert it to either an Ising ...
Nepomuk Hirsch's user avatar
2 votes
0 answers
81 views

Plotting Fisher Information using PennyLane

I made 2-qubit based circuit with post-selection method. Post-selection method is, Let $$ K = \begin{bmatrix} \sqrt{1-\gamma} & 0 \\ 0 & 1 \end{bmatrix}\,. $$ Then, $$ \rho_{\text{post-...
Donguk kim's user avatar
2 votes
0 answers
129 views

SLSQP optimizer(scipy.minimize) doesn't update parameters

I'm trying to find optimal parameters that minimize the cost functions. In cost function, it calculates the classical-fisher-information at a certain point(phi[0] = np.pi). Cost-function takes 3-...
Donguk kim's user avatar
2 votes
0 answers
73 views

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 ...
Donguk kim's user avatar
2 votes
0 answers
129 views

Comparative analysis of TensorFlow-Quantum, Pennylane, and Qiskit, to implement quantum CNNs

I am currently working on a project wherein I have to implement a Quantum Convolutional Neural Network. The best options for NISQ devices are hybrid algorithms, so I will try integrating quantum ...
Chan's user avatar
  • 131
2 votes
1 answer
146 views

Computing gradients in parallel with cost from probs (Pennylane-Braket)

Do circuits that measure probabilities instead of expectation values benefit from parallel execution? The Computing gradients in parallel with Amazon Braket tutorial shows how the multiple device ...
ryanhill1's user avatar
  • 2,473
2 votes
0 answers
126 views

Simulating density matrices in quantum simulators

I would like to load random quantum states sampled from a given density matrix based on its classical probabilities ie based on the definition of the given density matrix: $\rho = \sum_i p_i |\psi _i \...
quics-ilver's user avatar
1 vote
0 answers
39 views

Pennylane Spectral gap for Molecules

Pennylane's dataset has a lot of systems, including Quantum Chemistry molecules. Can I extract the spectral gap of the molecule from the dataset (assuming it contains the number). In the case that ...
Zee's user avatar
  • 199
1 vote
0 answers
40 views

Classical Fisher Information for 1-qubit vs 2-qubit in PennyLane

I'm attempting to examine the Classical Fisher Information (CFI) for a 1-qubit system in comparison to a 2-qubit system.(PennyLane) I anticipated that the CFI for the 2-qubit system would be double(at ...
Donguk kim's user avatar
1 vote
0 answers
37 views

How can I pass multiple embeddings in my function?

I have a problem with my code. I would like to try multiple embeddings in my kernel (I'm using the adjoint method). My idea is to pass them to the function and use them depending on what I pass. ...
BootBootBoot's user avatar
1 vote
1 answer
65 views

Where is the input data X in the CV-QNN as presented in Pennylane?

I am referring to the tutorial of CV-QNN in Pennylane(Strawberry Fields). Each layer of CV-QNN can perform the operation below. Unlike other quantum neural network tutorials, where the input X and y ...
user48217's user avatar
1 vote
0 answers
188 views

Drawing circuit in pennylane

I am trying to draw the circuit in pennylane but even after my hours of trying I am completely unsuccessful. Below is my code. Any little guidance of yours can help me a lot. ...
Manu's user avatar
  • 53
1 vote
0 answers
57 views

Why VQE don't work?

I try to make VQE optimizer, but something goes wrong at the optimization stage, more precisely, the parameters do not change and there is no gradient descent. Please tell me what I'm doing wrong? <...
Сударь Сударев's user avatar
1 vote
0 answers
97 views

What is an initial state of a qubit in PennyLane?

I just started trying to use the PennyLane Python package. It seems like the default.qubit device initializes each wire as an up-spin qubit. However, I am not ...
Silly Goose's user avatar
1 vote
0 answers
86 views

Convert an integer to its basis state in Cirq

I am trying to implement Quantum Adder using QFT in Cirq. I previously did the same problem using Pennylane, in which I converted an integer into its Basis state using the BasisStatePreparation method ...
Jessica John Britto's user avatar
1 vote
0 answers
65 views

The loss function decreases, but the test accuracy is always 0.5

...
Ren-Xin Zhao's user avatar
1 vote
0 answers
32 views

How do we know what angle formula X1 is encoded into qml.MottonenStatePreparation?

Known that X1 is a quantum state, it is prepared by qml.MottonenStatePreparation. How do we know what angle formula X1 is encoded into qml.MottonenStatePreparation? can be interpreted in python code. ...
Ren-Xin Zhao's user avatar
1 vote
0 answers
62 views

Universality : Working with one qubit

I am working on the Pennylane's code camp problems and I'm stuck with the challenge 4. I am utterly clueless about this question, as in what is it asking from me, they provide us with a $2\times 2$ ...
Marco Puerto's user avatar
1 vote
2 answers
370 views

Gradient descent for a quantum-classical hybrid neural network

I am working on implementing a quantum-classical hybrid neural network in qiskit where input data is encoded on a quantum circuit (with say 3 qubits) using a ...
quics-ilver's user avatar
1 vote
2 answers
493 views

Binary classification using a very simple Neural Net with Qiskit and Pennylane

I implemented a simple Neural Net with Pennylane and Qiskit for classifying two half moons: notebook for two half moons (GitHub). It works somehow (not overwhelmingly by any means): I tried running ...
Eldar Sultanow's user avatar
0 votes
0 answers
21 views

Qnode model gradient of inputs (not parameters!) question

I am trying to use qml to do physics informed quantum machine learning within Tensorflow. I know with TF, to get derivatives of the network's inputs (df/dx, for example), you can use with tf....
Corey's user avatar
  • 127
0 votes
0 answers
28 views

Deriving a equation in "Data re-uploading for a universal quantum classifier" paper: U(phi1,phi2,phi3) U(x1,x2,x3) = U(theta + w *x)

In "Data re-uploading for a universal quantum classifier" paper the U(phi1,phi2,phi3) U(x1,x2,x3) is derived as U(theta + w *x) in compact state. How to derive the above equation ?
Aakash's user avatar
  • 1
0 votes
1 answer
91 views

Implementing a Quantum Recurrent Neural Network

I want to implement a Quantum Recurrent Neural Network and use it for time series forecasting. As a starting point, I chose to implement it using the architecture given in this paper: https://arxiv....
MoBlufiz's user avatar
0 votes
0 answers
79 views

Data encoding (PennyLane) vs feature map (Qiskit)

I am new to quantum machine learning and I came across data encoding (in Pennylane) and feature map (in Qiskit). What are their similarities and differences?
sllama's user avatar
  • 1
0 votes
0 answers
26 views

Ensemble classification with Rigetti and Qiskit devices : Params.npy

I want ask how the params.npy variable were obtained? It would be great if you provide the codes for my better understanding. ...
Mas Dim's user avatar
0 votes
0 answers
35 views

PennyLane: How to shift operations in pennylane like in cirq

Cirq allows us to not shift operations all the way to the left by writing the following programs ...
Pratyush's user avatar
-1 votes
0 answers
35 views

Creating a random state drawn from Haar measure in Pennylane

How to create [2,1] random state vector using pennylane drawn from Haar measure. I have tried using chatGPt but the code I found wrong Posting the code as it is `import pennylane as qml dev = qml....
Sudhir Kumar's user avatar