{"id":6766,"library":"pennylane","title":"PennyLane","description":"PennyLane is a cross-platform Python library for differentiable programming of quantum computers, quantum machine learning, and quantum chemistry. It enables users to build, optimize, and deploy hybrid quantum-classical applications by seamlessly integrating with popular machine learning frameworks like NumPy, PyTorch, TensorFlow, and JAX. The library is under active development, with new versions and features released every few months, aiming to make quantum computing accessible for research and application development.","status":"active","version":"0.44.1","language":"python","source_language":"en","source_url":"https://github.com/PennyLaneAI/pennylane","tags":["quantum computing","quantum machine learning","QML","quantum chemistry","differentiable programming","hybrid quantum-classical"],"install":[{"cmd":"pip install pennylane","lang":"bash","label":"Stable release"},{"cmd":"pip install pennylane[all]","lang":"bash","label":"With all optional dependencies (e.g., JAX, PyTorch, TensorFlow)"}],"dependencies":[{"reason":"Core mathematical operations; integrated via an interface.","package":"numpy","optional":false},{"reason":"Optional interface for JAX integration and automatic differentiation.","package":"jax","optional":true},{"reason":"Optional interface for TensorFlow integration and automatic differentiation.","package":"tensorflow","optional":true},{"reason":"Optional interface for PyTorch integration and automatic differentiation.","package":"torch","optional":true}],"imports":[{"note":"The official documentation and community widely adopt `qml` as the standard alias for PennyLane.","symbol":"pennylane","correct":"import pennylane as qml"}],"quickstart":{"code":"import pennylane as qml\nfrom pennylane import numpy as np\n\n# Define a quantum device\ndev = qml.device(\"default.qubit\", wires=2)\n\n# Define a QNode (quantum function)\n@qml.qnode(dev)\ndef circuit(phi, theta):\n    qml.RX(phi[0], wires=0)\n    qml.RY(phi[1], wires=1)\n    qml.CNOT(wires=[0, 1])\n    qml.RX(theta, wires=0)\n    return qml.expval(qml.PauliZ(0))\n\n# Define parameters with automatic differentiation enabled\nphi_params = np.array([0.54, 0.12], requires_grad=True)\ntheta_param = np.array(0.9, requires_grad=True)\n\n# Execute the circuit\nresult = circuit(phi_params, theta_param)\nprint(f\"Circuit output: {result}\")\n\n# Compute gradients\ngrad_fn = qml.grad(circuit)\ngradients = grad_fn(phi_params, theta_param)\nprint(f\"Gradients: {gradients}\")","lang":"python","description":"This quickstart demonstrates how to define a quantum device, create a quantum circuit (QNode) with parameters, execute it, and compute gradients using PennyLane's automatic differentiation capabilities. This is a fundamental workflow for variational quantum algorithms."},"warnings":[{"fix":"Upgrade your NumPy installation to version 2.0 or newer: `pip install \"numpy>=2.0\"`.","message":"Maintenance support for NumPy versions less than 2.0 is deprecated as of PennyLane v0.44.x and will be completely dropped in v0.45. Future versions of PennyLane will only work with NumPy >= 2.0.","severity":"breaking","affected_versions":">=0.44.0 (deprecation), >=0.45.0 (removal)"},{"fix":"If on MacOS, migrate to an ARM-based Mac or build x86 wheels manually if absolutely necessary. Ensure your Python environment is 3.11 or newer.","message":"Support for Intel MacOS platforms (x86) has been removed as of PennyLane v0.44.x, impacting Macs running on Intel processors. Support for Python 3.10 was deprecated in v0.42 and removed in subsequent releases. Minimum Python version for current PennyLane is 3.11.","severity":"breaking","affected_versions":">=0.44.0 (Intel Mac), >=0.42.0 (Python 3.10 deprecation)"},{"fix":"Refactor custom decomposition logic to use the new graph-based decomposition system and `qml.decomposition` module.","message":"The `custom_decomps` keyword argument for `qml.device` is deprecated and will be removed in v0.45. New decomposition rules should be defined as quantum functions with registered resources using `qml.decomposition.enable_graph`.","severity":"deprecated","affected_versions":">=0.44.0 (deprecation), >=0.45.0 (removal)"},{"fix":"Update code to use `operator.is_verified_hermitian` property or call the `qml.is_hermitian(operator)` function for a more comprehensive check.","message":"Accessing hermiticity via `pennylane.operation.Operator.is_hermitian` is deprecated. Use `is_verified_hermitian` for better reflection of functionality or the `is_hermitian()` function for thorough verification.","severity":"deprecated","affected_versions":">=0.44.0 (deprecation), >=0.45.0 (removal)"},{"fix":"Change any instances of `level=None` to `level='device'` when calling these introspection and workflow functions.","message":"The argument `level=None` is no longer valid for functions like `qml.specs()`, `qml.draw()`, `workflow.get_transform_program()`, `workflow.construct_batch()`, `drawer.draw_mpl()`. It must be replaced with `level='device'` to apply all transforms.","severity":"breaking","affected_versions":">=0.44.0"}],"env_vars":null,"search_vec":"'access':69 'activ':53 'aim':64 'applic':34,73 'build':26 'chemistri':21,82 'classic':33,88 'comput':15,68,76 'cross':6 'cross-platform':5 'deploy':29 'develop':54,74 'differenti':11,83 'enabl':23 'everi':61 'featur':59 'framework':42 'hybrid':30,85 'integr':37 'jax':48 'learn':18,41,79 'librari':9,50 'like':43 'machin':17,40,78 'make':66 'month':63 'new':56 'numpi':44 'optim':27 'pennylan':1,2 'platform':7 'popular':39 'program':12,84 'python':8 'pytorch':45 'qml':80 'quantum':14,16,20,32,67,75,77,81,87 'quantum-class':31,86 'releas':60 'research':71 'seamless':36 'tensorflow':46 'user':24 'version':57","created_at":"2026-04-15T18:42:03.216890+00:00","updated_at":"2026-04-16T17:58:18.616732+00:00","problems":[{"fix":"Install the required PennyLane plugin for the device (e.g., `pip install pennylane-qiskit` for Qiskit devices, `pip install pennylane-qulacs` for Qulacs). If in a notebook environment like Google Colab, ensure you restart the runtime after installation.","cause":"This error occurs when trying to use a PennyLane quantum device (e.g., 'qiskit.aer', 'qulacs.simulator') whose corresponding plugin has not been installed, or when running in environments like Google Colab without restarting the runtime after installation.","error":"DeviceError: Device does not exist. Make sure the required plugin is installed."},{"fix":"Upgrade PennyLane to the latest version using `pip install --upgrade pennylane`. If the issue persists, consult the PennyLane release notes or documentation for specific API changes related to the attribute or module in question.","cause":"This error indicates that the PennyLane library version is outdated, and a function, module, or attribute being accessed has been renamed, moved, or removed in a newer release, leading to an 'AttributeError' or similar import issues for refactored internal modules.","error":"AttributeError: module 'pennylane' has no attribute '...' (e.g., 'matrix', 'template', 'workflow')"},{"fix":"Install the `quimb` library by running `pip install quimb` in your terminal or command prompt.","cause":"This error arises when attempting to use the `default.tensor` device or other tensor-network-related functionalities in PennyLane without having the `quimb` library installed in the Python environment.","error":"ImportError: This feature requires quimb, a library for tensor network manipulations. It can be installed with:\n\npip install quimb"},{"fix":"Reduce the number of qubits in your circuit when using `default.mixed`. For larger qubit counts, consider using a state-vector simulator like `default.qubit` or `lightning.qubit`, which are more memory-efficient for pure state simulations, or explore advanced techniques like circuit cutting for very large systems.","cause":"This specific `ValueError` often occurs with the `default.mixed` device when attempting to simulate circuits with a large number of qubits (typically more than 16-17). The `default.mixed` device simulates density matrices, which leads to an exponential increase in memory requirements with the number of qubits, quickly exhausting available memory.","error":"ValueError: cannot reshape array of size X into shape (2, 2, 2, ...)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.45.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://pennylane.ai","github":"https://github.com/PennyLaneAI/pennylane","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pennylane/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}