Conversation
|
🤔 So far it doesn't work (using a |
Copilot helped a lot, but I'm not sure if it's recommending a suitable QC approach.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new approach to quantum circuit creation using PennyLane, aiming to run experiments on a real quantum device. The key changes include:
- Insertion of a new markdown cell that documents the transition to a PennyLane-based approach.
- Addition of multiple code cells to build and execute a quantum circuit based on a Boolean formula, including clause conversion and QAOA circuit construction.
- Integration of simulation devices for analytic and sampling evaluations of the cost Hamiltonian.
Comments suppressed due to low confidence (2)
quantum_computing.ipynb:905
- Consider adding an inline comment to explain the expected structure of 'params', ensuring future readers understand that each layer in the QAOA circuit expects a pair of parameters (gamma and beta).
" gamma, beta = params[layer]\n",
quantum_computing.ipynb:906
- It would be helpful to document why '1' is used as the number of time steps in ApproxTimeEvolution, clarifying its intended role in the QAOA circuit.
" qml.templates.ApproxTimeEvolution(cost_h, gamma, 1)\n",
| " projector = (qml.Identity(idx) - sign * qml.PauliZ(idx)) / 2\n", | ||
| " projectors.append(projector)\n", | ||
| " if projectors:\n", | ||
| " term = reduce(lambda a, b: a @ b, projectors)\n", |
There was a problem hiding this comment.
Adding a brief comment to explain the use of the '@' operator for combining projectors may improve readability and aid maintainability.
|
💡 Solution for |
Unsuccessful, cannot create a Session having a free account.
|
PennyLane-Qiskit plugin creates a session even for the most simple circuits, like this taken from docs: dev_real_test = qml.device('qiskit.remote', wires=5, backend=backend, shots=10)
@qml.qnode(dev_real_test)
def circuit_real_test(x, y, z):
qml.RZ(z, wires=[0])
qml.RY(y, wires=[0])
qml.RX(x, wires=[0])
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(wires=1))
circuit_real_test(0.2, 0.1, 0.3)But IBM doesn't allow free accounts to use sessions. It seems it's been already fixed in PennyLaneAI/pennylane-qiskit#632, but it's still not released and the actual master branch produces (probably an unrelated) error |
A new attempt to use QC. This time hopefully even on a real (IBM?) device.