pennylane
pennylane copied to clipboard
PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
Here we add the `Operator` attributes `has_decomposition` and `has_adjoint` in analogy to `has_matrix`. They allow faster decisions of whether a decomposition/adjoint is available than calling `decomposition/adjoint` and catching exceptions. Similar...
### Before submitting Please complete the following checklist when submitting a PR: - [x] All new features must include a unit test. If you've fixed a bug or added code...
**Context:** When composing operations, sums and products of operators can get very big (lots of summands and factors). Computing the matrix of such composite operators will be very time consuming....
1. Compare the `op.hash` when using `qml.equal` with operator arithmetic. 2. Take into account the `op.name` when sorting summands. 3. Add `op.hash` to some arithmetic operators. 4. Use `qml.equal` in...
**Context:** This PR adds a function for basis rotation grouping of a molecular Hamiltonian. **Description of the Change:** The function `basis_rotation` is added to qchem.factorization module. **Benefits:** **Possible Drawbacks:** **Related...
### Expected behavior The below code should print out the quantities: ```python def debug(): dev = qml.device("default.qubit", wires=2) @qml.qnode(dev) def circuit(x): qml.RY(x, wires=0) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliX(0) @ qml.PauliZ(1)), qml.expval(qml.PauliZ(0)...
**Context:** We want to take advantage of the known rules for obtaining the products of Pauli operators to enhance the speed of operator arithmetic. This is one prototype which uses...
For manipulations involving large matrices, we want to cut down on memory allocation whenever possible. One way to do that is by using in-place manipulations instead. ```pycon >>> mat1 +=...
Currently, unwrapping operator arithmetic data can cause a multitude of `VisibleDeprecationWarnings` from ragged arrays: ``` import warnings warnings.simplefilter("error") with qml.tape.QuantumTape() as tape: obs = qml.op_sum(qml.s_prod(torch.tensor(1.2), qml.PauliX(0)), qml.PauliZ(0)) qml.expval(obs) with qml.tape.Unwrap(tape):...
Added a small modification in the `qml.simplify` function to simplify (and group) multiple operators in a QNode. Example: ```python dev = qml.device("default.qubit", wires=2) @qml.qnode(dev) def circuit(x): qml.RX(x, 0) qml.RX(1, 0)...