qml¶
This is the top level module from which all basic functions and classes of PennyLane can be directly imported.
Functions¶
|
QNode constructor for creating QNodes. |
|
Prints the information for pennylane installation. |
|
Apply a function to the constituent QNodes of a |
|
Applies a unitary multiple times to a specific pattern of wires. |
|
Load a |
Disable tape mode. |
|
|
Lazily perform the dot product between arrays, tensors, and |
|
draw(qnode, charset=”unicode”): Create a function that draws the given _qnode. |
Enable tape mode. |
|
|
Expectation value of the supplied observable. |
|
Loads pyQuil Program objects by using the converter in the PennyLane-Forest plugin. |
|
Loads quantum circuits from a QASM string using the converter in the PennyLane-Qiskit plugin. |
|
Loads quantum circuits from a QASM file using the converter in the PennyLane-Qiskit plugin. |
|
Loads Qiskit QuantumCircuit objects by using the converter in the PennyLane-Qiskit plugin. |
|
Loads quantum circuits from a Quil string using the converter in the PennyLane-Forest plugin. |
|
Loads quantum circuits from a Quil file using the converter in the PennyLane-Forest plugin. |
|
Invert a list of operations or a template. |
|
Returns the Jacobian as a callable function of vector-valued (functions of) QNodes. |
|
Repeatedly applies a unitary a given number of times. |
|
Load external quantum assembly and quantum circuits from supported frameworks into PennyLane templates. |
|
Map a quantum template over a list of observables to create a |
|
Probability of each computational basis state. |
|
Decorator for creating QNodes. |
Scan installed PennyLane plugins to refresh the device list. |
|
|
Sample from the supplied observable, with the number of shots determined from the |
|
Lazily sum the constituent QNodes of a |
Returns whether tape mode is enabled. |
|
|
Register a quantum template with PennyLane. |
|
Variance of the supplied observable. |
|
Returns the PennyLane version number. |
Classes¶
|
Gradient-descent optimizer with past-gradient-dependent learning rate in each dimension. |
|
Gradient-descent optimizer with adaptive learning rate, first and second moment. |
|
Single-qubit amplitude damping error channel. |
|
Prepares a single computational basis state. |
|
Beamsplitter interaction. |
|
Single-qubit bit flip (Pauli \(X\)) error channel. |
|
The controlled-NOT operator |
|
The controlled-RX operator |
|
The controlled-RY operator |
|
The controlled-RZ operator |
|
The controlled-Rot operator |
|
The controlled-swap operator |
|
The controlled-Y operator |
|
The controlled-Z operator |
|
Prepares a cat state. |
|
Represents a quantum circuit as a directed acyclic graph. |
|
Prepares a coherent state. |
|
Configuration class. |
|
Controlled addition operation. |
|
Controlled phase operation. |
|
Cross-Kerr interaction. |
|
Cubic phase shift. |
|
Single-qubit symmetrically depolarizing error channel. |
|
Abstract base class for PennyLane devices. |
Exception raised by a |
|
|
Apply an arbitrary fixed diagonal unitary matrix. |
|
Prepares a displaced squeezed vacuum state. |
|
Phase space displacement. |
|
Create a cost function that gives the expectation value of an input Hamiltonian. |
|
Prepare subsystems using the given density matrix in the Fock basis. |
|
Prepares a single Fock state. |
|
The number state observable \(\ket{n}\bra{n}\). |
|
Prepare subsystems using the given ket vector in the Fock basis. |
|
Prepare subsystems in a given Gaussian state. |
|
Single-qubit generalized amplitude damping error channel. |
|
Basic gradient-descent optimizer. |
|
The Hadamard operator |
|
Lightweight class for representing Hamiltonians for Variational Quantum Eigensolver problems. |
|
An arbitrary Hermitian observable. |
|
The identity observable \(\I\). |
|
A linear interferometer transforming the bosonic operators according to the unitary matrix \(U\). |
|
Kerr interaction. |
|
Gradient-descent optimizer with momentum. |
|
Arbitrary multi Z rotation. |
This class mocks out the qchem module in case it is not installed. |
|
|
Gradient-descent optimizer with Nesterov momentum. |
|
The photon number observable \(\langle \hat{n}\rangle\). |
|
The momentum quadrature observable \(\hat{p}\). |
|
Arbitrary Pauli word rotation. |
|
The Pauli X operator |
|
The Pauli Y operator |
|
The Pauli Z operator |
|
Single-qubit phase damping error channel. |
|
Single-qubit bit flip (Pauli \(Z\)) error channel. |
|
Arbitrary single qubit local phase shift |
|
An arbitrary second-order polynomial observable. |
|
Optimizer with adaptive learning rate, via calculation of the diagonal or block-diagonal approximation to the Fubini-Study metric tensor. |
|
Represents a sequence of independent QNodes that all share the same signature. |
|
The generalized quadrature observable \(\x_\phi = \x cos\phi+\p\sin\phi\). |
|
Quadratic phase shift. |
Exception raised when an illegal operation is defined in a quantum function. |
|
|
Apply an arbitrary fixed quantum channel. |
|
Abstract base class for PennyLane qubit devices. |
|
Prepare subsystems using the given ket vector in the computational basis. |
|
Apply an arbitrary fixed unitary matrix. |
Abstract base class for classes that exposes a queue for objects. |
|
|
Root mean squared propagation optimizer. |
|
The single qubit X rotation |
|
The single qubit Y rotation |
|
The single qubit Z rotation |
|
Arbitrary single qubit rotation |
|
Phase space rotation. |
|
Rotoselect gradient-free optimizer. |
Rotosolve gradient free optimizer. |
|
|
The single-qubit phase gate |
|
The swap operator |
|
The single-qubit Square-Root X operator. |
|
Prepares a squeezed vacuum state. |
|
Phase space squeezing. |
|
The single-qubit T gate |
|
The tensor product of the |
|
Prepares a thermal state. |
|
Toffoli (controlled-controlled-X) gate. |
|
Phase space two-mode squeezing. |
|
U1 gate. |
|
U2 gate. |
|
Arbitrary single qubit unitary. |
|
Create a cost function that gives the expectation value of an input Hamiltonian. |
|
The position quadrature observable \(\hat{x}\). |
|
Returns the gradient as a callable function of (functions of) QNodes. |
Class Inheritance Diagram¶

Contents
Downloads