{"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":"en","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,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}