Questions tagged [pennylane]

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

82 questions
2
votes
1 answer

How can I see the circuit that was actually executed on the device in pennylane?

I do a VQE using the pennylane UCCSD ansatz for execution on the 'default.qubit' device and am interested in the actual circuit that is executed on the device (ideally without making changes in any pennylane code directly). Is there a way to…
qcabepsilon
  • 195
  • 9
1
vote
0 answers

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? import pennylane as qml from pennylane import…
1
vote
1 answer

Qubits are drawn multiple times in circuit using pennylane

When I draw my circuits some qubits are drawn multiple times (see 'circuit 1'). Does this mean that 1) the circuit itself is the same as 'circuit 2' below or 2) do I have some bug in my code that causes this and my circuit is not equivalent to…
qcabepsilon
  • 195
  • 9
1
vote
1 answer

How can one append a pre-defined quantum function (circuit) to another quantum function in Pennylane?

I want to use a pennylane quantum function that i created earlier somewhere else, again in a new function but have it applied to certain wires. The reason for this is, that I have a quantum circuit of which a sub-part i want to test out with…
1
vote
0 answers

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

def layer(W): for i in range(wires1): qml.Rot(W[i, 0], W[i, 1], W[i, 2], wires=i) for i in range(wires1 - 1): qml.CNOT(wires=[i, i + 1]) @qml.qnode(dev1) def conv_net(features, para): """ …
Ren-Xin Zhao
  • 536
  • 3
  • 12