Repository Analysis

PennyLaneAI/pennylane

PennyLane is an open-source quantum software platform for quantum computing, quantum machine learning, and quantum chemistry. Create meaningful quantum algorithms, from inspiration to implementation.

24.4 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of PennyLaneAI/pennylane, a Python project with 3,393 GitHub stars. SynthScan v2.0 examined 682,511 lines of code across 1464 source files, recording 11919 pattern matches distributed across 21 syntactic categories. The overall adjusted score of 24.4 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

24.4
Adjusted Score
24.4
Raw Score
100%
Time Factor
2026-08-08
Last Push
3.4K
Stars
Python
Language
682.5K
Lines of Code
1.5K
Files
11.9K
Pattern Hits
2026-08-09
Scan Date
0.91
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 1325MEDIUM 266LOW 10328

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 11919 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers7641 hits · 6920 pts
SeverityFileLineSnippetContext
LOWtests/test_wires.py61 def test_creation_from_iterables_of_exotic_elements(self, iterable):CODE
LOWtests/test_wires.py67 def test_creation_from_wires_object(self):CODE
LOWtests/test_wires.py73 def test_creation_from_wires_lists(self):CODE
LOWtests/test_wires.py82 def test_creation_from_different_wire_types(self, iterable):CODE
LOWtests/test_wires.py90 def test_creation_from_single_object(self, wire):CODE
LOWtests/test_wires.py100 def test_error_for_incorrect_wire_types(self, input):CODE
LOWtests/test_wires.py109 def test_error_for_repeated_wires(self, iterable):CODE
LOWtests/test_wires.py116 def test_indexing_and_slicing(self, iterable):CODE
LOWtests/test_wires.py177 def test_add_two_wires_objects(self):CODE
LOWtests/test_wires.py183 def test_add_wires_object_with_iterable(self):CODE
LOWtests/test_wires.py190 def test_add_wires_with_inbuilt_sum(self):CODE
LOWtests/test_wires.py196 def test_representation_and_string(self):CODE
LOWtests/test_wires.py204 def test_array_representation(self):CODE
LOWtests/test_wires.py580 def test_error_for_incorrect_jax_arrays(self, input):CODE
LOWtests/test_wires.py589 def test_error_for_repeated_wires_jax(self, iterable):CODE
LOWtests/test_wires.py594 def test_array_representation_jax(self):CODE
LOWtests/test_wires.py46 def test_creation_from_common_iterables(self, iterable):CODE
LOWtests/test_wires.py215 def test_jax_array_representation(self):CODE
LOWtests/test_wires.py243 def test_convert_to_numpy_array(self):CODE
LOWtests/test_wires.py310 def test_select_random_method(self):CODE
LOWtests/test_wires.py406 def test_wires_pytree_with_array_leaves(self):CODE
LOWtests/test_wires.py496 def test_symmetric_difference(self, wire_a, wire_b, expected):CODE
LOWtests/test_wires.py561 def test_creation_from_jax_array(self, iterable, expected):CODE
LOWtests/conftest.py143def enable_disable_dynamic_shapes():CODE
LOWtests/conftest.py164def enable_graph_decomposition():CODE
LOWtests/conftest.py171def disable_graph_decomposition():CODE
LOWtests/conftest.py178def enable_and_disable_graph_decomp(request):CODE
LOWtests/conftest.py246def pytest_collection_modifyitems(items, config):CODE
LOWtests/test_autograd_grad.py23def test_informative_error_on_bad_shape():CODE
LOWtests/test_typing.py36 def test_isinstance_unknown_type(self):CODE
LOWtests/test_typing.py45 def test_isinstance_numpy_array(self):CODE
LOWtests/test_typing.py49 def test_isinstance_pennylane_tensor(self):CODE
LOWtests/test_typing.py54 def test_isinstance_jax_array_is_tensor_like(self):CODE
LOWtests/test_typing.py62 def test_isinstance_torch_tensor_is_tensor_like(self):CODE
LOWtests/test_typing.py70 def test_isinstance_tf_tensor_is_tensor_like(self):CODE
LOWtests/test_typing.py80 def test_subclass_unknown_type(self):CODE
LOWtests/test_typing.py89 def test_subclass_numpy_array(self):CODE
LOWtests/test_typing.py93 def test_subclass_pennylane_tensor(self):CODE
LOWtests/test_typing.py98 def test_subclass_jax_array_is_tensor_like(self):CODE
LOWtests/test_typing.py105 def test_subclass_torch_tensor_is_tensor_like(self):CODE
LOWtests/test_typing.py112 def test_subclass_tf_tensor_is_tensor_like(self):CODE
LOWtests/test_typing.py393 def test_instance_check_unknown_rank(self):CODE
LOWtests/test_typing.py400 def test_instance_check_rejects_non_array(self):CODE
LOWtests/test_typing.py405 def test_weak_type_for_number_dtypes(self):CODE
LOWtests/test_typing.py412 def test_is_compatible_with_non_numeric_input(self):CODE
LOWtests/test_typing.py417 def test_is_compatible_with_weak_scalar(self):CODE
LOWtests/test_typing.py427 def test_is_compatible_with_weak_array(self):CODE
LOWtests/test_typing.py436 def test_is_compatible_with_arbitrary_shape(self):CODE
LOWtests/test_typing.py443 def test_is_compatible_with_list(self):CODE
LOWtests/test_typing.py449 def test_is_compatible_with_unknown_axes(self):CODE
LOWtests/test_typing.py457 def test_is_compatible_with_torch_tensor(self):CODE
LOWtests/test_typing.py230 def test_invalid_shape_tuple_error(self):CODE
LOWtests/test_typing.py328 def test_error_indexing_into_non_scalar(self):CODE
LOWtests/test_typing.py346 def test_error_len_on_dynamic_zeroeth_axis(self):CODE
LOWtests/param_shift_dev.py65 def execute_and_compute_derivatives(self, circuits, execution_config=None):CODE
LOWtests/test_qcut.py3188 def test_mc_complicated_circuit(self, dev_fn, mocker):CODE
LOWtests/test_qcut.py317 def test_wrapped_obj_eq_false(self, obj1, obj2):CODE
LOWtests/test_qcut.py323 def test_wrapped_obj_eq_false_other_obj(self):CODE
LOWtests/test_qcut.py393 def test_converted_graph_nodes(self):CODE
LOWtests/test_qcut.py409 def test_converted_graph_edges(self):CODE
7581 more matches not shown…
Cross-File Repetition1136 hits · 5680 pts
SeverityFileLineSnippetContext
HIGHtests/test_wires.py0tests that we can compare compilepipeline objects with the '==' and '!=' operators.STRING
HIGHtests/core/test_transform.py0tests that we can compare compilepipeline objects with the '==' and '!=' operators.STRING
HIGHtests/core/test_compile_pipeline.py0tests that we can compare compilepipeline objects with the '==' and '!=' operators.STRING
HIGHtests/test_qcut.py0test that ``_wrappedobj.__eq__`` returns false when expected.STRING
HIGHtests/circuit_graph/test_circuit_graph.py0test that ``_wrappedobj.__eq__`` returns false when expected.STRING
HIGHtests/gradients/core/test_metric_tensor.py0test that ``_wrappedobj.__eq__`` returns false when expected.STRING
HIGHtests/test_qcut.py0test that _wrappedobj.__eq__ returns false when the object being compared is not a _wrappedobj.STRING
HIGHtests/circuit_graph/test_circuit_graph.py0test that _wrappedobj.__eq__ returns false when the object being compared is not a _wrappedobj.STRING
HIGHtests/gradients/core/test_metric_tensor.py0test that _wrappedobj.__eq__ returns false when the object being compared is not a _wrappedobj.STRING
HIGHtests/test_qcut.py0test that ``_wrappedobj.__eq__`` returns true when expected.STRING
HIGHtests/circuit_graph/test_circuit_graph.py0test that ``_wrappedobj.__eq__`` returns true when expected.STRING
HIGHtests/gradients/core/test_metric_tensor.py0test that ``_wrappedobj.__eq__`` returns true when expected.STRING
HIGHtests/test_qcut.py0test that ``_wrappedobj.__hash__`` is the object id.STRING
HIGHtests/circuit_graph/test_circuit_graph.py0test that ``_wrappedobj.__hash__`` is the object id.STRING
HIGHtests/gradients/core/test_metric_tensor.py0test that ``_wrappedobj.__hash__`` is the object id.STRING
HIGHtests/test_qcut.py0test that the ``wrappedobj` representation is equivalent to the repr of the object it wraps.STRING
HIGHtests/circuit_graph/test_circuit_graph.py0test that the ``wrappedobj` representation is equivalent to the repr of the object it wraps.STRING
HIGHtests/gradients/core/test_metric_tensor.py0test that the ``wrappedobj` representation is equivalent to the repr of the object it wraps.STRING
HIGHtests/test_queuing.py0test that the ``wrappedobj` representation is equivalent to the repr of the object it wraps.STRING
HIGHtests/default_qubit_legacy.py0allows slicing along an arbitrary axis of an array or tensor. args: index (int): the index to access axis (int): the axiSTRING
HIGHpennylane/devices/qubit/apply_operation.py0allows slicing along an arbitrary axis of an array or tensor. args: index (int): the index to access axis (int): the axiSTRING
HIGHpennylane/devices/qubit_mixed/apply_operation.py0allows slicing along an arbitrary axis of an array or tensor. args: index (int): the index to access axis (int): the axiSTRING
HIGHtests/test_return_types_legacy.py0helper function to get the total number of shot copies from a shot vector.STRING
HIGHtests/test_return_types_qnode.py0helper function to get the total number of shot copies from a shot vector.STRING
HIGHtests/test_return_types.py0helper function to get the total number of shot copies from a shot vector.STRING
HIGHtests/test_return_types_legacy.py0test that single measurements return behavior does not change.STRING
HIGHtests/test_return_types_qnode.py0test that single measurements return behavior does not change.STRING
HIGHtests/test_return_types.py0test that single measurements return behavior does not change.STRING
HIGHtests/test_return_types_legacy.py0test the new return types for multiple measurements, it should always return a tuple containing the single measurements.STRING
HIGHtests/test_return_types_qnode.py0test the new return types for multiple measurements, it should always return a tuple containing the single measurements.STRING
HIGHtests/test_return_types.py0test the new return types for multiple measurements, it should always return a tuple containing the single measurements.STRING
HIGHpennylane/devices/tests/test_return_system.py0test the new return types for multiple measurements, it should always return a tuple containing the single measurements.STRING
HIGHtests/test_return_types_legacy.py0test the support for executing qnodes with the same type of measurement multiple times using a device with shot vectorsSTRING
HIGHtests/test_return_types.py0test the support for executing qnodes with the same type of measurement multiple times using a device with shot vectorsSTRING
HIGHtests/test_return_types_qnode.py0test the support for executing qnodes with the same type of measurement multiple times using a device with shot vectorsSTRING
HIGHtests/test_return_types_legacy.py0test the support for executing qnodes with multiple different measurements using a device with shot vectorsSTRING
HIGHtests/test_return_types.py0test the support for executing qnodes with multiple different measurements using a device with shot vectorsSTRING
HIGHtests/test_return_types_qnode.py0test the support for executing qnodes with multiple different measurements using a device with shot vectorsSTRING
HIGHtests/test_return_types_legacy.py0test scalar-valued and sample measurements where sample takes an observable.STRING
HIGHtests/test_return_types_qnode.py0test scalar-valued and sample measurements where sample takes an observable.STRING
HIGHtests/test_return_types.py0test scalar-valued and sample measurements where sample takes an observable.STRING
HIGHtests/test_return_types_legacy.py0test scalar-valued and computational basis sample measurements.STRING
HIGHtests/test_return_types_qnode.py0test scalar-valued and computational basis sample measurements.STRING
HIGHtests/test_return_types.py0test scalar-valued and computational basis sample measurements.STRING
HIGHtests/test_return_types_legacy.py0test scalar-valued and counts measurements where counts takes an observable.STRING
HIGHtests/test_return_types_qnode.py0test scalar-valued and counts measurements where counts takes an observable.STRING
HIGHtests/test_return_types.py0test scalar-valued and counts measurements where counts takes an observable.STRING
HIGHtests/test_return_types_legacy.py0test scalar-valued and computational basis counts measurements.STRING
HIGHtests/test_return_types_qnode.py0test scalar-valued and computational basis counts measurements.STRING
HIGHtests/test_return_types.py0test scalar-valued and computational basis counts measurements.STRING
HIGHtests/test_return_types_legacy.py0test sample and counts measurements, each measurement with custom samples or computational basis state samples.STRING
HIGHtests/test_return_types_qnode.py0test sample and counts measurements, each measurement with custom samples or computational basis state samples.STRING
HIGHtests/test_return_types.py0test sample and counts measurements, each measurement with custom samples or computational basis state samples.STRING
HIGHtests/test_return_types_legacy.py0test scalar-valued, probability, sample and counts measurements all in a single qfunc.STRING
HIGHtests/test_return_types_qnode.py0test scalar-valued, probability, sample and counts measurements all in a single qfunc.STRING
HIGHtests/test_return_types.py0test scalar-valued, probability, sample and counts measurements all in a single qfunc.STRING
HIGHtests/test_return_types_legacy.py0check that an error is raised if the return type of an observable is unsupportedSTRING
HIGHtests/test_return_types.py0check that an error is raised if the return type of an observable is unsupportedSTRING
HIGHtests/devices/test_legacy_device.py0check that an error is raised if the return type of an observable is unsupportedSTRING
HIGHtests/devices/test_qubit_device.py0check that an error is raised if the return type of an observable is unsupportedSTRING
1076 more matches not shown…
Unused Imports1790 hits · 1466 pts
SeverityFileLineSnippetContext
LOWsetup.py1CODE
LOWtests/conftest.py22CODE
LOWtests/conftest.py29CODE
LOWtests/conftest.py196CODE
LOWtests/conftest.py204CODE
LOWtests/kernels/test_kernels.py36CODE
LOWtests/kernels/test_kernels.py37CODE
LOWtests/io/test_qualtran_io.py42CODE
LOWtests/qchem/vibrational/conftest.py26CODE
LOWtests/qchem/vibrational/conftest.py40CODE
LOWtests/qchem/vibrational/conftest.py54CODE
LOWtests/qchem/vibrational/conftest.py89CODE
LOWtests/qchem/openfermion_pyscf_tests/conftest.py58CODE
LOWtests/qchem/openfermion_pyscf_tests/conftest.py59CODE
LOWtests/data/data_manager/test_dataset_access.py47CODE
LOWtests/devices/default_tensor/test_default_tensor.py270CODE
LOW.github/workflows/scripts/upload_reports/upload.py5CODE
LOWpennylane/__init__.py22CODE
LOWpennylane/__init__.py23CODE
LOWpennylane/__init__.py24CODE
LOWpennylane/__init__.py25CODE
LOWpennylane/__init__.py25CODE
LOWpennylane/__init__.py27CODE
LOWpennylane/__init__.py28CODE
LOWpennylane/__init__.py29CODE
LOWpennylane/__init__.py30CODE
LOWpennylane/__init__.py31CODE
LOWpennylane/__init__.py32CODE
LOWpennylane/__init__.py32CODE
LOWpennylane/__init__.py33CODE
LOWpennylane/__init__.py34CODE
LOWpennylane/__init__.py35CODE
LOWpennylane/__init__.py36CODE
LOWpennylane/__init__.py37CODE
LOWpennylane/__init__.py38CODE
LOWpennylane/__init__.py38CODE
LOWpennylane/__init__.py39CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py40CODE
LOWpennylane/__init__.py48CODE
LOWpennylane/__init__.py49CODE
LOWpennylane/__init__.py50CODE
LOWpennylane/__init__.py51CODE
LOWpennylane/__init__.py52CODE
LOWpennylane/__init__.py53CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py54CODE
LOWpennylane/__init__.py63CODE
LOWpennylane/__init__.py63CODE
LOWpennylane/__init__.py63CODE
LOWpennylane/__init__.py63CODE
1730 more matches not shown…
Docstring Block Structure179 hits · 895 pts
SeverityFileLineSnippetContext
HIGHpennylane/operation.py41Calculate the derivative of an operation. For an operation :math:`e^{i \hat{H} \phi t}`, this function returns the STRING
HIGHpennylane/_grad/value_and_grad.py135A :func:`~.qjit`-compatible transformation for returning the result and jacobian of a function. This function aSTRING
HIGHpennylane/_grad/jvp.py140A :func:`~.qjit` compatible Jacobian-vector product of PennyLane programs. This function allows the Jacobian-vectorSTRING
HIGH…labs/trotter_error/product_formulas/product_formula.py150Compose several product formulas into a single recursive formula. This represents the ordered product of the giSTRING
HIGH…labs/trotter_error/product_formulas/product_formula.py240Raise the formula to the power ``z``. This multiplies the existing :attr:`exponent` by ``z``. The original formSTRING
HIGHpennylane/labs/tcdq/mmd_loss.py76Choose a reasonable radial basis function (RBF) kernel bandwidth from the target dataset. A good starting point forSTRING
HIGHpennylane/labs/tcdq/mmd_loss.py211Compute the MMD loss between a qubit IQP circuit and a target dataset. This function estimates how far the circuit'STRING
HIGHpennylane/labs/tcdq/qudit_mmd_loss.py317Build a reusable loss function that computes the qudit graph-kernel MMD. The returned callable measures the distancSTRING
HIGHpennylane/labs/tcdq/qudit_expval_functions.py140Convert a qudit gate dictionary into a generator matrix and parameter map. Unlike the qubit version, generator vectSTRING
HIGHpennylane/labs/tcdq/qudit_expval_functions.py445Build an estimator for expectation values of a qudit IQP circuit. Returns a pure function that estimates the compleSTRING
HIGHpennylane/labs/tcdq/training.py178Create the requested JAX optimizer. Args: name (str): The name of the optimizer to create ('GradientDescentSTRING
HIGHpennylane/labs/profiler/resource_profile.py367Converts a resource profile into a data structure compatible with `icicle/flame-graphs <https://plotly.com/python/icicleSTRING
HIGHpennylane/labs/profiler/extract.py47Profile the quantum resources required to implement a circuit or operator in terms of a given gate set. In additionSTRING
HIGHpennylane/labs/estimator_beta/estimate.py82Estimate the quantum resources required to implement a circuit or operator in terms of a given gateset. This functiSTRING
HIGH…ane/labs/estimator_beta/wires_manager/wire_counting.py45A recursive function that tracks auxiliary qubits via three quantities over the course of the workflow. It tracks thSTRING
HIGH…ane/labs/estimator_beta/wires_manager/wire_counting.py174A private function that pre-processes the quantum tape obtained from a qfunc as part of the wire tracking pipeline. STRING
HIGH…ane/labs/estimator_beta/wires_manager/wire_counting.py253Determine the number of auxiliary qubits needed to decompose the operators of a quantum circuit into a specific ``gaSTRING
HIGH…ane/labs/estimator_beta/wires_manager/wire_counting.py340Determine the number of auxiliary qubits needed to decompose the operators in a :class:`~.pennylane.estimator.resourSTRING
HIGHpennylane/labs/estimator_beta/templates/subroutines.py1626Input validation for the various parameters and optimizes the batch_size and bits_per_iter. Args: nSTRING
HIGH…ne/labs/estimator_beta/ops/qubit/non_parametric_ops.py28Returns a list representing the resources for a controlled version of the :class:`~.pennylane.estimator.ops.qubit.non_paSTRING
HIGHpennylane/capture/autograph/transformer.py213Utility function to retrieve the source code of a function converted by AutoGraph. .. warning:: Nested funSTRING
HIGHpennylane/core/queuing.py447Apply an instantiated operator or measurement to a queuing context. Args: op (.Operator or .MeasurementProcSTRING
HIGHpennylane/core/qscript.py46Process the annotated queue, creating a list of quantum operations and measurement processes. Args: queSTRING
HIGHpennylane/optimize/qng.py322Restores an arbitrary nested structure to a flattened iterable. See also :func:`_flatten`. Args: flat STRING
HIGHpennylane/optimize/spsa.py22The Simultaneous Perturbation Stochastic Approximation method (SPSA) is a stochastic approximation algorithm for optSTRING
HIGHpennylane/qaoa/cycle.py310Calculates the loss Hamiltonian for the maximum-weighted cycle problem. We consider the problem of selecting a cyclSTRING
HIGHpennylane/qaoa/cycle.py468Calculates the `out flow constraint <https://1qbit.com/whitepaper/arbitrage/>`__ Hamiltonian for the maximum-weighteSTRING
HIGHpennylane/qaoa/cycle.py522Calculates the `net flow constraint <https://doi.org/10.1080/0020739X.2010.526248>`__ Hamiltonian for the maximum-weSTRING
HIGHpennylane/liealg/lie_closure.py52Compute the (dynamical) Lie algebra from a set of generators. The Lie closure, pronounced "Lee" closure, is a way tSTRING
HIGHpennylane/liealg/lie_closure.py208Find a linearly independent basis of a list of (skew-) Hermitian matrices .. note:: The first ``subbasis_length`` eSTRING
HIGHpennylane/estimator/estimate.py57Estimate the quantum resources required to implement a circuit or operator in terms of a given gateset. Args: STRING
HIGHpennylane/estimator/estimate.py654Apply the default decomposition for a given symbolic operator (Adjoint, Control, Pow). Args: base_compr_resSTRING
HIGHpennylane/estimator/templates/qsp.py890Returns a list representing the resources of the operator. Each object in the list represents a gate and the numSTRING
HIGHpennylane/estimator/ops/op_math/symbolic.py1036Create the adjoint of a resource-tracking gate. For a :class:`~.GateCount`, it wraps the gate in :class:`~.AdjoSTRING
HIGHpennylane/io/io.py415Converts a Qiskit `NoiseModel <https://qiskit.github.io/qiskit-aer/stubs/qiskit_aer.noise.NoiseModel.html>`__ into aSTRING
HIGHpennylane/io/qasm_interpreter.py220 Rotates a BitType variable left by n bits. Note we need a Variable because we need to know the size of the regiSTRING
HIGHpennylane/io/qasm_interpreter.py345 Attempts to retrieve a variable from the current context by name. Args: name (str): the naSTRING
HIGHpennylane/io/qasm_interpreter.py414 If the attribute is not found on the class, instead uses the attr name as an index into the context dicSTRING
HIGHpennylane/io/qasm_interpreter.py563 Entry point for visiting the QASMNodes of a parsed OpenQASM 3.0 program. Args: node (QASMNSTRING
HIGHpennylane/io/qasm_interpreter.py1040 Index into a variable using an IndexExpression. Args: var (Variable): The data structure rSTRING
HIGHpennylane/io/qasm_interpreter.py1370 Helper to setup the quantum gate call, also resolving arguments and wires. Args: node (QuaSTRING
HIGHpennylane/io/qasm_interpreter.py1401 Sets up wires for a QuantumGate or QuantumPhase application. Args: node (QuantumPhase | QuSTRING
HIGHpennylane/io/qasm_interpreter.py1526 Registers a Cast expression. Args: node (Cast): The Cast expression. context (STRING
HIGHpennylane/io/qasm_interpreter.py1616 An alias is registered as a callable since we need to be able to evaluate it at a later time. STRING
HIGHpennylane/io/qasm_interpreter.py1642 Registers an identifier. Args: node (Identifier): The identifier. context (ConSTRING
HIGHpennylane/io/qualtran_io.py812Reads a `Qualtran Bloq <https://qualtran.readthedocs.io/en/latest/bloqs/index.html#bloqs-library>`_ signature and reSTRING
HIGHpennylane/io/qualtran_io.py1438 Converts a PennyLane :class:`~.QNode`, ``Qfunc``, or :class:`~.Operation` to the corresponding `Qualtran Bloq <httpSTRING
HIGHpennylane/ftqc/lattice.py125Generates a :class:`~pennylane.ftqc.Lattice` object with a given geometric parameters and its shape name. Args: STRING
HIGHpennylane/ftqc/parametric_midmeasure.py82Perform a mid-circuit measurement in the basis defined by the plane and angle on the supplied qubit. The measurSTRING
HIGHpennylane/ftqc/parametric_midmeasure.py192Perform a mid-circuit measurement in the X basis. The measurements are performed using the 0, 1 convention rather thSTRING
HIGHpennylane/ftqc/parametric_midmeasure.py241Perform a mid-circuit measurement in the Y basis. The measurements are performed using the 0, 1 convention rather thSTRING
HIGHpennylane/ftqc/parametric_midmeasure.py290Perform a mid-circuit measurement in the Z basis. The measurements are performed using the 0, 1 convention rather thSTRING
HIGHpennylane/ftqc/parametric_midmeasure.py627Diagonalize any mid-circuit measurements in a parameterized basis into the computational basis. Args: tape STRING
HIGHpennylane/fermi/fermionic.py319Shifts an operator in the FermiWord from ``initial_position`` to ``final_position`` by applying the fermionic anti-commuSTRING
HIGHpennylane/spin/spin_hamiltonian.py332Generates the Hamiltonian for the Emery model on a lattice. The `Hamiltonian <https://arxiv.org/pdf/2309.11786>`_ fSTRING
HIGHpennylane/spin/spin_hamiltonian.py498Generates the Hamiltonian for the Haldane model on a lattice. The `Hamiltonian <https://arxiv.org/pdf/2211.13615>`_STRING
HIGHpennylane/spin/spin_hamiltonian.py632Generates the Hamiltonian for the Kitaev model on the honeycomb lattice. The `Kitaev <https://arxiv.org/abs/cond-maSTRING
HIGHpennylane/spin/spin_hamiltonian.py717Generates a spin Hamiltonian for a custom :class:`~pennylane.spin.Lattice` object. Args: lattice (Lattice):STRING
HIGHpennylane/spin/lattice.py32Constructs a Lattice object. Args: n_cells (list[int]): Number of cells in each direction of the grid. STRING
HIGHpennylane/qchem/tapering.py468Instantiates objects for whichever of the ``operation`` or ``op_gen`` args are callables. For the former, it is doneSTRING
119 more matches not shown…
Self-Referential Comments147 hits · 475 pts
SeverityFileLineSnippetContext
MEDIUMtests/dummy_debugger.py26 # Create a dummy object to act as the deviceCOMMENT
MEDIUMtests/default_qubit_legacy.py219 # Create the initial state. Internally, we store theSTRING
MEDIUMtests/default_qubit_legacy.py1022 # Create a locally rolling seed by using deterministic context propertiesCOMMENT
MEDIUMtests/core/test_transform.py685 # Create a simple device and tapeCOMMENT
MEDIUMtests/core/test_compile_pipeline.py1503 # Create a single QuantumScript (not wrapped in a tuple)COMMENT
MEDIUMtests/core/test_compile_pipeline.py1681 # Create a dummy device with a custom preprocess_transforms methodCOMMENT
MEDIUMtests/core/test_compile_pipeline.py1695 # Create a program with transformsCOMMENT
MEDIUMtests/liealg/test_horizontal_cartan_subalgebra.py200 # Create a non-orthonormal basis on 1 qubitCOMMENT
MEDIUMtests/liealg/test_horizontal_cartan_subalgebra.py204 # Create an adjvec for three operators, which we understand to be in basis_0COMMENT
MEDIUMtests/liealg/test_horizontal_cartan_subalgebra.py218 # Create a non-orthonormal basis on 2 qubitsCOMMENT
MEDIUMtests/liealg/test_horizontal_cartan_subalgebra.py222 # Create an adjvec for 13 operators, which we understand to be in basis_1COMMENT
MEDIUMtests/ftqc/test_mbqc_gates.py67 # Define the graph structure for the RZ cluster state (omit node 1 for input):COMMENT
MEDIUMtests/ftqc/test_mbqc_gates.py119 # Define the graph structure for the CNOT cluster state (omit nodes 1 and 9 for input)COMMENT
MEDIUMtests/ftqc/test_qubit_graph.py641 # Create a cyclically nested graphCOMMENT
MEDIUMtests/ftqc/test_qubit_graph.py159 # Create the expected graph structure for Surface Code 17COMMENT
MEDIUMtests/math/test_matrix_manipulation.py30# Define a list of dtypes to testCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py847 # Define a 2-qubit density matrixCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py862 # Define a batch of 2-qubit density matricesCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py886 # Define a 2-qubit density matrixCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py899 # Define a 2-qubit density matrixCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py914 # Define a 2-qubit density matrixCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py933 # Define a 2-qubit density matrixCOMMENT
MEDIUMtests/math/test_matrix_manipulation.py1181 # Create a positive definite matrixCOMMENT
MEDIUMtests/transforms/zx/test_converter.py329 # Create the qubits in the graph and the qubit mapperCOMMENT
MEDIUMtests/transforms/zx/test_converter.py398 # Create the qubits in the graph and the qubit mapperCOMMENT
MEDIUMtests/transforms/zx/test_converter.py451 # Create the qubits in the graph and the qubit mapperCOMMENT
MEDIUMtests/transforms/zx/test_converter.py504 # Create the qubits in the graph and the qubit mapperCOMMENT
MEDIUMtests/workflow/test_qnode_legacy.py1180 # Create a uniform probability distribution for 2 qubitsCOMMENT
MEDIUMtests/workflow/test_qnode_legacy.py1199 # Create a uniform probability distribution for 2 qubitsCOMMENT
MEDIUMtests/workflow/test_qnode_legacy.py1217 # Create a biased probability distribution (not uniform to make differences more apparent)COMMENT
MEDIUMtests/workflow/test_qnode_legacy.py1271 # Create a circuit that performs classical shadow measurementCOMMENT
MEDIUMtests/workflow/test_qnode_legacy.py1415 # Create a simple tape for executionCOMMENT
MEDIUMtests/ops/op_math/test_linear_combination.py1474 # Create a graph with unique solution so that test does not depend on solver/implementationCOMMENT
MEDIUMtests/measurements/test_probs.py250 # Define a batch of density matricesCOMMENT
MEDIUMtests/measurements/test_probs.py285 # Define a density matrix for a 4-qubit systemCOMMENT
MEDIUMtests/measurements/test_purity_measurement.py101 # Define a non-trivial two-qubit density matrixCOMMENT
MEDIUMtests/measurements/test_purity_measurement.py112 # Define the wires (qubits) of our systemCOMMENT
MEDIUMtests/measurements/test_var.py234 # Define a non-trivial two-qubit density matrixCOMMENT
MEDIUMtests/measurements/test_mutual_info.py108 # Define a pure, entangled two-qubit state (|00> + |11>) / sqrt(2)COMMENT
MEDIUMtests/measurements/test_vn_entropy.py136 # Define a non-trivial two-qubit density matrixCOMMENT
MEDIUMtests/devices/test_default_mixed.py128 # Create a QNode with the specified interfaceCOMMENT
MEDIUMtests/devices/test_default_mixed.py161 # Create a QNode with the specified interfaceCOMMENT
MEDIUMtests/devices/test_null_qubit.py1375 # Create a custom operator that's not in the standard gatesetCOMMENT
MEDIUMtests/devices/test_null_qubit.py1383 # Create a tape with this custom operatorCOMMENT
MEDIUMtests/devices/test_preprocess.py510 # Create a tape with an operation that needs decompositionCOMMENT
MEDIUMtests/devices/test_preprocess.py611 # Create a tape with an operation that needs decompositionCOMMENT
MEDIUMtests/devices/qubit/test_apply_operation.py136 # Create a random unitary matrixCOMMENT
MEDIUMtests/devices/qubit/test_apply_operation.py140 # Create a random state vectorCOMMENT
MEDIUMtests/devices/qubit/test_apply_operation.py155 # Create a random unitary matrixCOMMENT
MEDIUMtests/devices/qubit/test_apply_operation.py159 # Create a random state vectorCOMMENT
MEDIUMtests/devices/qubit/test_apply_operation.py222 # Create a dense state, shape (2,2,2)COMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py126 # Create a sparse observableCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py204 # Create a Sum observable that involves the operatorsCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py208 # Create the measurement processCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py211 # Create a mock state (you would normally use a real state here)COMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py736 # Define the readout error probabilityCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py739 # Define the readout error operation using qp.BitFlipCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py743 # Define the state: let's use the |+⟩ stateCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_measure.py747 # Define the observableCOMMENT
MEDIUMtests/devices/qubit_mixed/test_qubit_mixed_simulate.py237 # Create a cache dictionary to store statesCOMMENT
87 more matches not shown…
Over-Commented Block383 hits · 354 pts
SeverityFileLineSnippetContext
LOWconftest.py1# Copyright 2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/conftest.py1# Copyright 2018-2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/test_qcut.py1# Copyright 2022 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/test_compiler.py1# Copyright 2023 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/test_about.py1# Copyright 2018-2020 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/kernels/test_kernels.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/drawer/test_draw_catalyst.py1# Copyright 2023 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/drawer/test_tape_mpl.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/drawer/test_draw.py1# Copyright 2018-2022 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/drawer/test_tape_text.py1# Copyright 2018-2020 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_while_loop.py1# Copyright 2018-2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_transforms.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_nested_plxpr.py1# Copyright 2018-2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_operators.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_dynamic_shapes.py1# Copyright 2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_base_interpreter.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_measurements_capture.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/capture_utils.py1# Copyright 2026 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_cond.py1# Copyright 2018-2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_mid_measure.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_qnode.py1# Copyright 2018-2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_meta_type.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_custom_primitives.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_for_loop.py1# Copyright 2018-2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/test_capture_pauli_measure.py1# Copyright 2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/autograph/test_if_else.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/autograph/test_autograph_for_loop.py1# Copyright 2023 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/autograph/test_autograph_while_loop.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/autograph/test_autograph.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/autograph/test_autograph_logical_ops.py1# Copyright 2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/transforms/test_capture_decompose.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOW…sts/capture/transforms/test_capture_graph_decompose.py1# Copyright 2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/capture/gradients/test_capture_diff.py521 # + prod_cos_e_i[:, :, None] / x[None, None, :]COMMENT
LOWtests/gpu/test_gpu_torch.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/core/test_compile_pipeline.py1# Copyright 2023 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/core/operator/test_operator2.py1# Copyright 2026 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/core/operator/operator2_utils.py1# Copyright 2026 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/core/operator/test_operator2_capture.py1# Copyright 2026 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/core/operator/test_operator2_equality.py1# Copyright 2026 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_optimize_shot_adaptive.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_optimize.py1# Copyright 2018-2020 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_qnspsa.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_momentum_qng.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_qng_qjit.py1# Copyright 2018-2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_rotosolve.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/optimize/test_qng.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/circuit_graph/test_circuit_graph.py1# Copyright 2018-2020 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/fourier/test_qnode_spectrum.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/fourier/test_coefficients.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/fourier/test_reconstruct.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/fourier/test_visualize.py1# Copyright 2018-2021 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/shadow/test_shadow_class.py1# Copyright 2022 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/shadow/test_shadow_transforms.py1# Copyright 2022 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/shadow/test_shadow_entropies.py1# Copyright 2022 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/liealg/test_horizontal_cartan_subalgebra.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/liealg/test_lie_closure.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/liealg/test_cartan_decomp.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/liealg/test_involutions.py1# Copyright 2024 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/estimator/test_estimator_second_quantization.py1# Copyright 2018-2025 Xanadu Quantum Technologies Inc.COMMENT
LOWtests/estimator/test_estimator_first_quantization.py1# Copyright 2018-2025 Xanadu Quantum Technologies Inc.COMMENT
323 more matches not shown…
Decorative Section Separators111 hits · 282 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_qcut.py3194 0: ──X──//─╭C───//──RX─╭C───//─╭C──╭//────────────────────┤STRING
MEDIUMtests/test_qcut.py3195 1: ────────╰X──────────╰X───//─╰Z──╰//────────────────╭RX─┤ ╭SampleSTRING
MEDIUMtests/test_qcut.py4382 0: ──BasisState(M0)──//───────╭C───//──RX(0.40)─╭C───//─╭C────────╭//──────────────────STRING
MEDIUMtests/test_qcut.py4383 1: ───────────────────────────╰X────────────────╰X───//─╰Z────────╰//──────────────────STRING
MEDIUMtests/test_qcut.py4385 3: ─────────────────╰RY(0.50)──//──H──╭C─────────//──H──╰C─────────//─╭RY(0.89)──//──H─STRING
MEDIUMtests/test_qcut.py5414 1: ─╰X──RY──//─╭C──RY────────────────────────────────────────────────────────┤ ├<Z@Z@Z@Z@Z@Z@Z@Z>STRING
MEDIUMtests/test_qcut.py5415 2: ────────────╰X──RY──//─╭C──RY─────────────────────────────────────────────┤ ├<Z@Z@Z@Z@Z@Z@Z@Z>STRING
MEDIUMtests/test_qcut.py5416 3: ───────────────────────╰X──RY──//─╭C──RY──────────────────────────────────┤ ├<Z@Z@Z@Z@Z@Z@Z@Z>STRING
MEDIUMtests/test_qcut.py5417 4: ──────────────────────────────────╰X──RY──//─╭C──RY───────────────────────┤ ├<Z@Z@Z@Z@Z@Z@Z@Z>STRING
MEDIUMtests/test_qcut.py5418 5: ─────────────────────────────────────────────╰X──RY──//─╭C──RY────────────┤ ├<Z@Z@Z@Z@Z@Z@Z@Z>STRING
MEDIUMtests/test_return_types_legacy.py749# -------------------------------------------------COMMENT
MEDIUMtests/test_return_types_legacy.py751# -------------------------------------------------COMMENT
MEDIUMtests/test_return_types_qnode.py2188# -------------------------------------------------COMMENT
MEDIUMtests/test_return_types_qnode.py2190# -------------------------------------------------COMMENT
MEDIUMtests/gate_data.py7# ========================================================COMMENT
MEDIUMtests/gate_data.py9# ========================================================COMMENT
MEDIUMtests/gate_data.py96# ========================================================COMMENT
MEDIUMtests/gate_data.py98# ========================================================COMMENT
MEDIUMtests/test_return_types.py774# -------------------------------------------------COMMENT
MEDIUMtests/test_return_types.py776# -------------------------------------------------COMMENT
MEDIUMtests/workflow/interfaces/execute/test_jax.py110 # ------------------------------------COMMENT
MEDIUMtests/workflow/interfaces/execute/test_torch.py105 # ------------------------------------COMMENT
MEDIUMtests/workflow/interfaces/execute/test_autograd.py85 # ------------------------------------COMMENT
MEDIUMtests/ops/functions/test_equal.py1311 # ------------------COMMENT
MEDIUMtests/ops/functions/test_equal.py1326 # ------------------COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py371 # ============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py410 # =============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py463 # =============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py491 # ============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py508 # ============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py533 # =============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py563 # =============================================COMMENT
MEDIUMtests/gradients/core/test_metric_tensor.py591 # ============================================COMMENT
MEDIUM.github/workflows/docs.yml2# -----------------COMMENT
MEDIUM.github/workflows/docs.yml15# -----------------COMMENT
MEDIUMdoc/conf.py340# ============================================================COMMENT
MEDIUMpennylane/exceptions.py82# =============================================================================STRING
MEDIUMpennylane/exceptions.py84# =============================================================================STRING
MEDIUMpennylane/exceptions.py124# =============================================================================COMMENT
MEDIUMpennylane/exceptions.py126# =============================================================================COMMENT
MEDIUMpennylane/exceptions.py180# =============================================================================COMMENT
MEDIUMpennylane/exceptions.py182# =============================================================================COMMENT
MEDIUMpennylane/exceptions.py205# =============================================================================COMMENT
MEDIUMpennylane/exceptions.py207# =============================================================================COMMENT
MEDIUMpennylane/labs/tests/conftest.py26# ==========================================================COMMENT
MEDIUMpennylane/labs/tests/conftest.py211# ============================COMMENT
MEDIUMpennylane/labs/tests/dla/test_dense_utils.py94 # -------------------COMMENT
MEDIUMpennylane/qcut/utils.py119 1: ──RY(0.2)─╰X──//─╭●─╰X──────────┤ │STRING
MEDIUMpennylane/qcut/utils.py137 1: ──RY(0.2)─╰X──//─╭●──//─╰X───────┤ │STRING
MEDIUMpennylane/qcut/utils.py197 0: ──RX──//─╭●──//────────╭●──//────────┤ ╭<X@Y@Z>STRING
MEDIUMpennylane/qcut/utils.py198 1: ──RY──//─╰X──//─╭●──//─╰X────────────┤ │STRING
MEDIUMpennylane/qcut/utils.py200 b: ──RY──//─╰X──//────────╰X──//──RY────┤ ╰<X@Y@Z>STRING
MEDIUMpennylane/core/qscript.py217 # ========================================================COMMENT
MEDIUMpennylane/core/qscript.py219 # ========================================================COMMENT
MEDIUMpennylane/core/qscript.py543 # ========================================================COMMENT
MEDIUMpennylane/core/qscript.py545 # ========================================================COMMENT
MEDIUMpennylane/core/qscript.py771 # ========================================================STRING
MEDIUMpennylane/core/qscript.py773 # ========================================================STRING
MEDIUMpennylane/core/qscript.py904 # ========================================================STRING
MEDIUMpennylane/core/qscript.py906 # ========================================================STRING
51 more matches not shown…
Deep Nesting263 hits · 250 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py246CODE
LOWtests/conftest.py308CODE
LOWtests/test_qcut.py4871CODE
LOWtests/test_qcut.py1305CODE
LOWtests/default_qubit_legacy.py300CODE
LOWtests/test_return_types_legacy.py884CODE
LOWtests/test_return_types_legacy.py991CODE
LOWtests/test_return_types_legacy.py1090CODE
LOWtests/test_return_types_legacy.py1144CODE
LOWtests/test_return_types_qnode.py2327CODE
LOWtests/test_return_types_qnode.py2528CODE
LOWtests/test_return_types_qnode.py2581CODE
LOWtests/test_return_types_qnode.py2954CODE
LOWtests/test_return_types_qnode.py3018CODE
LOWtests/test_return_types_qnode.py3050CODE
LOWtests/test_return_types.py1185CODE
LOWtests/kernels/test_kernels.py625CODE
LOWtests/capture/capture_utils.py38CODE
LOWtests/capture/autograph/test_autograph_array_update.py39CODE
LOWtests/capture/autograph/test_autograph_array_update.py42CODE
LOW…sts/capture/transforms/test_capture_graph_decompose.py576CODE
LOWtests/optimize/test_rotosolve.py30CODE
LOWtests/io/qasm_interpreter/test_interpreter.py837CODE
LOWtests/docs/test_supported_confs.py258CODE
LOWtests/qchem/test_factorization.py396CODE
LOWtests/qchem/vibrational/test_pes_generator.py384CODE
LOWtests/qchem/openfermion_pyscf_tests/test_convert.py895CODE
LOWtests/workflow/interfaces/qnode/test_torch_qnode.py1431CODE
LOWtests/workflow/interfaces/qnode/test_jax_jit_qnode.py2119CODE
LOWtests/templates/layers/test_particle_conserving_u1.py108CODE
LOW…sts/templates/state_preparations/test_partial_unary.py120CODE
LOW…sts/templates/state_preparations/test_partial_unary.py157CODE
LOWtests/qnn/test_iqp_expval.py114CODE
LOWtests/qnn/test_iqp_expval.py153CODE
LOWtests/ops/qubit/test_non_parametric_ops.py309CODE
LOWtests/ops/qubit/test_non_parametric_ops.py344CODE
LOWtests/ops/qubit/test_non_parametric_ops.py381CODE
LOWtests/ops/qubit/test_non_parametric_ops.py429CODE
LOWtests/ops/qubit/test_non_parametric_ops.py469CODE
LOWtests/ops/op_math/test_exp.py508CODE
LOWtests/pauli/test_pauli_arithmetic.py933CODE
LOWtests/pauli/grouping/test_pauli_graph_colouring.py27CODE
LOWtests/gradients/core/test_hadamard_gradient.py1024CODE
LOWtests/data/data_manager/test_dataset_access.py155CODE
LOWtests/measurements/test_probs.py666CODE
LOWtests/measurements/test_probs.py724CODE
LOWtests/devices/test_device_api.py459CODE
LOWtests/devices/test_device_api.py512CODE
LOWtests/devices/test_preprocess.py639CODE
LOWpennylane/registers.py21CODE
LOWpennylane/registers.py81CODE
LOWpennylane/about.py56CODE
LOWpennylane/circuit_graph.py82CODE
LOWpennylane/labs/dla/variational_kak.py350CODE
LOWpennylane/labs/tests/tcdq/test_iqp_expval.py93CODE
LOW…nylane/labs/tests/templates/test_trotter_fragmented.py121CODE
LOWpennylane/labs/trotter_error/product_formulas/bch.py336CODE
LOW…lane/labs/trotter_error/product_formulas/commutator.py279CODE
LOW…labs/trotter_error/realspace/realspace_coefficients.py206CODE
LOWpennylane/labs/tcdq/utils.py61CODE
203 more matches not shown…
Redundant / Tautological Comments45 hits · 51 pts
SeverityFileLineSnippetContext
LOWtests/pulse/test_rydberg.py89 # Set interaction_coeff to one for easier comparisonCOMMENT
LOWtests/pauli/test_pauli_arithmetic.py860 assert copied_string1 == result # Check if the modified object matches the expected resultCODE
LOWtests/pauli/test_pauli_arithmetic.py869 assert copy_ps1 == res # Check if the modified object matches the expected resultCODE
LOWtests/measurements/test_probs.py268 # Check if the calculated probabilities match the expected valuesCOMMENT
LOWtests/measurements/test_probs.py315 # Check if the calculated probabilities match the expected valuesCOMMENT
LOWtests/devices/qubit/test_sampling.py1326 # Check if the distribution is roughly correct (allowing for some variance)COMMENT
LOWtests/devices/qubit/test_sampling.py1335 # Check if all possible states are presentCOMMENT
LOWtests/devices/qubit_mixed/test_qubit_mixed_measure.py215 # Check if we hit the tensor contraction branchCOMMENT
LOWpennylane/capture/jax_patches.py265 # Check if we're in the inline pathCOMMENT
LOWpennylane/capture/autograph/transformer.py66 # Check if the function has already been converted.COMMENT
LOWpennylane/capture/autograph/ag_primitives.py230 # Assign tracers to the iteration variables identified by AutoGraph (iter_args in mlir).COMMENT
LOWpennylane/core/operator/operator2.py1483 # Check if either shape or dtype is not compatibleCOMMENT
LOWpennylane/core/operator/base.py1011 # Check if the expected number of parameters coincides with the one received.COMMENT
LOWpennylane/fourier/visualize.py60 # Check if the user provided a single set of coefficients to a function that isCOMMENT
LOWpennylane/liealg/cartan_decomp.py187 # Check if rank increases by adding matices from ``subspace``COMMENT
LOWpennylane/qchem/vibrational/localize_modes.py130 # Check if the minimization was successful; if it wasn't, proceed with the normal modes.STRING
LOWpennylane/math/__init__.py179 # Check if object is purely realCOMMENT
LOWpennylane/math/utils.py175 # Check if all non-zeros in the sparse matrix match the scalarCOMMENT
LOWpennylane/math/quantum.py1227 # Check if the matrix is HermitianCOMMENT
LOWpennylane/math/quantum.py1232 # Check if positive semi-definiteCOMMENT
LOWpennylane/transforms/optimization/pattern_matching.py1702 # Check if two groups of matches are incompatible.COMMENT
LOW…e/transforms/optimization/merge_amplitude_embedding.py69 # Check if the current gate is an AmplitudeEmbedding.STRING
LOWpennylane/transforms/optimization/merge_rotations.py203 # Check if the rotation is composable; if it is not, move on.STRING
LOW…lane/transforms/decompositions/clifford_t_transform.py104 # Check if matrix can be calculated for the operatorSTRING
LOW…lane/transforms/decompositions/clifford_t_transform.py340 # Check if the subsequent gate exists in the vicinityCOMMENT
LOWpennylane/ops/op_math/exp.py337 # Check if the exponential can be decomposed into a PauliRot gateCOMMENT
LOWpennylane/ops/op_math/decompositions/grid_problems.py645 # Check if the solution is follows the constraints of the target-region.COMMENT
LOWpennylane/ops/op_math/decompositions/grid_problems.py698 # Check if it is easier to solve problem for either of x-or-y-interval.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py814 # Check if we are indeed within the intended interval.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py853 f_adj2 = False # Check if we need to apply the sqrt(2) conjugation.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py871 # Check if we are solving the problem for the intended interval.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py888 # Check if the bounds on the interval contains an integer.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py891 # Check if the solution satisfies both bounds on x and y.STRING
LOWpennylane/ops/op_math/decompositions/grid_problems.py894 # Check if the consecutive solutions are within the desired bounds.STRING
LOWpennylane/ops/op_math/decompositions/ross_selinger.py61 # Check if abs_theta is an odd multiple of PI_8STRING
LOWpennylane/ops/op_math/decompositions/rings.py130 if (dv := ZSqrtTwo(n1 // d, n2 // d)) != ZSqrtTwo(0, 0): # Check if floor division worksSTRING
LOWpennylane/ops/op_math/decompositions/norm_solver.py400 # Check if the next_xi is divisible by the element eta in Z[√2].STRING
LOWpennylane/ops/functions/is_commuting.py320 # Check if operations are non simplified rotations and return commutation if it is the case.STRING
LOWpennylane/pauli/pauli_vspace.py292 # Check if new vector is linearly dependent on the current basisSTRING
LOWpennylane/decomposition/decomposition_graph.py920 # Check if this decomposition is feasible under the work wire constraintCOMMENT
LOWpennylane/devices/default_clifford.py145 # Check if the operation is noisyCOMMENT
LOWpennylane/devices/default_clifford.py725 # Check if the rotation was permissibleCOMMENT
LOWpennylane/devices/default_clifford.py965 # Check if it is CliffordSTRING
LOWpennylane/devices/_qubit_device.py636 # Check if there is an overridden version of the measurement processCOMMENT
LOWpennylane/devices/_qubit_device.py684 # Check if the state is accessible and decide to return the state or the densityCOMMENT
AI Structural Patterns54 hits · 50 pts
SeverityFileLineSnippetContext
LOWtests/default_qubit_legacy.py297CODE
LOWtests/capture/test_capture_qnode.py396CODE
LOWtests/capture/transforms/test_capture_decompose.py369CODE
LOWtests/transforms/test_split_non_commuting.py144CODE
LOWtests/workflow/interfaces/qnode/test_jax_jit_qnode.py1865CODE
LOWtests/workflow/interfaces/qnode/test_jax_jit_qnode.py1904CODE
LOWtests/workflow/interfaces/qnode/test_jax_jit_qnode.py1946CODE
LOWtests/workflow/interfaces/execute/test_jax_jit.py504CODE
LOWtests/workflow/interfaces/execute/test_jax_jit.py811CODE
LOWtests/workflow/interfaces/execute/test_jax_jit.py842CODE
LOWtests/gradients/core/test_pulse_gradient.py1298CODE
LOWtests/measurements/test_counts.py771CODE
LOWpennylane/labs/dla/recursive_cartan_decomp.py106CODE
LOWpennylane/labs/trotter_error/product_formulas/bch.py155CODE
LOWpennylane/qcut/kahypar.py30CODE
LOWpennylane/qcut/processing.py77CODE
LOWpennylane/core/transforms/transform.py417CODE
LOWpennylane/core/transforms/transform.py468CODE
LOW…nnylane/estimator/qpe_resources/second_quantization.py98CODE
LOWpennylane/io/qasm_interpreter.py612CODE
LOWpennylane/qchem/molecule.py83CODE
LOWpennylane/qchem/openfermion_pyscf.py490CODE
LOWpennylane/qchem/openfermion_pyscf.py876CODE
LOWpennylane/qchem/dipole.py326CODE
LOWpennylane/qchem/hamiltonian.py402CODE
LOWpennylane/qchem/hamiltonian.py495CODE
LOWpennylane/qchem/hamiltonian.py546CODE
LOWpennylane/qchem/vibrational/vibrational_class.py98CODE
LOWpennylane/qchem/vibrational/pes_generator.py735CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py66CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py131CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py203CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py272CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py346CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py440CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py538CODE
LOWpennylane/qchem/vibrational/christiansen_utils.py642CODE
LOWpennylane/math/multi_dispatch.py665CODE
LOWpennylane/transforms/commutation_dag.py153CODE
LOWpennylane/transforms/decompose.py355CODE
LOWpennylane/transforms/decompose.py87CODE
LOWpennylane/workflow/execution.py52CODE
LOWpennylane/workflow/qnode.py505CODE
LOWpennylane/workflow/interfaces/jax_jit.py192CODE
LOWpennylane/workflow/interfaces/torch.py171CODE
LOWpennylane/ops/functions/assert_valid.py654CODE
LOWpennylane/ops/functions/assert_valid.py731CODE
LOWpennylane/gradients/spsa_gradient.py71CODE
LOWpennylane/gradients/spsa_gradient.py107CODE
LOWpennylane/gradients/jvp.py469CODE
LOWpennylane/devices/preprocess.py269CODE
LOWpennylane/devices/qubit_mixed/measure.py93CODE
LOWpennylane/devices/qubit_mixed/measure.py314CODE
LOWpennylane/devices/qubit_mixed/apply_operation.py255CODE
Modern Structural Boilerplate57 hits · 48 pts
SeverityFileLineSnippetContext
LOWdoc/conf.py21logger = logging.getLogger(__name__)CODE
LOWpennylane/_grad/__init__.py23__all__ = ["grad", "jacobian", "jvp", "vjp", "value_and_grad"]CODE
LOWpennylane/labs/__init__.py46__all__ = []STRING
LOWpennylane/labs/trotter_error/__init__.py106__all__ = [STRING
LOWpennylane/labs/trotter_error/fragments/__init__.py20__all__ = [CODE
LOW…nylane/labs/trotter_error/product_formulas/__init__.py20__all__ = [CODE
LOW…ylane/labs/trotter_error/realspace/realspace_matrix.py109 def set_block(self, row: int, col: int, rs_sum: RealspaceSum) -> None:STRING
LOWpennylane/labs/trotter_error/realspace/__init__.py21__all__ = [CODE
LOWpennylane/labs/tcdq/__init__.py316__all__ = [STRING
LOWpennylane/capture/primitives.py57__all__ = [CODE
LOWpennylane/capture/autograph/ag_primitives.py45__all__ = [CODE
LOWpennylane/core/__init__.py125__all__ = [CODE
LOWpennylane/core/queuing.py574__all__ = ["QueuingManager", "AnnotatedQueue", "apply"]CODE
LOWpennylane/core/qscript.py1183__all__ = [CODE
LOWpennylane/core/measurements.py587__all__ = ["MeasurementProcess", "SampleMeasurement", "StateMeasurement", "MeasurementTransform"]CODE
LOWpennylane/core/transforms/__init__.py32__all__ = ["transform", "Transform", "BoundTransform", "CompilePipeline"]CODE
LOWpennylane/core/operator/channel.py90__all__ = ["Channel"]STRING
LOWpennylane/core/operator/__init__.py158__all__ = [STRING
LOWpennylane/core/operator/state_prep.py60__all__ = ["StatePrepBase"]CODE
LOWpennylane/core/operator/base.py1793__all__ = ["Operator", "Operation"]STRING
LOWpennylane/optimize/__init__.py39__all__ = [STRING
LOWpennylane/qaoa/__init__.py100__all__ = [CODE
LOWpennylane/liealg/__init__.py134__all__ = [STRING
LOWpennylane/estimator/resource_config.py273 def set_single_qubit_rot_precision(self, precision: float) -> None:STRING
LOWpennylane/ftqc/primitives.py23__all__ = [CODE
LOWpennylane/ftqc/__init__.py58__all__ = [STRING
LOWpennylane/math/__init__.py211__all__ = [CODE
LOWpennylane/concurrency/__init__.py93__all__ = ["native", "external", "backends", "base"]STRING
LOWpennylane/concurrency/executors/__init__.py24__all__ = [STRING
LOWpennylane/concurrency/executors/native/__init__.py40__all__ = ["MPPoolExec", "PyNativeExec", "ProcPoolExec", "ThreadPoolExec", "SerialExec"]CODE
LOWpennylane/concurrency/executors/external/__init__.py35__all__ = [STRING
LOWpennylane/pytrees/__init__.py27__all__ = [CODE
LOWpennylane/workflow/execution.py38logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/_capture_qnode.py101logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/qnode.py44logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/qnode.py751 def _set_shots(self, shots: int | Shots) -> None:CODE
LOWpennylane/workflow/jacobian_products.py32logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/interfaces/tensorflow.py113logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/interfaces/jax.py157logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/interfaces/autograd.py97logger = logging.getLogger(__name__)CODE
LOWpennylane/workflow/interfaces/torch.py73logger = logging.getLogger(__name__)CODE
LOWpennylane/templates/core.py895__all__ = [CODE
LOWpennylane/templates/subroutines/__init__.py76__all__ = [STRING
LOWpennylane/qnn/torch.py551 def set_input_argument(input_name: str = "inputs") -> None:CODE
LOWpennylane/control_flow/for_loop.py36logger = logging.getLogger(__name__)CODE
LOWpennylane/resource/__init__.py58__all__ = [STRING
LOWpennylane/data/data_manager/progress/__init__.py90__all__ = ["Progress", "Task"]CODE
LOWpennylane/data/data_manager/progress/_rich.py33__all__ = ["make_progress", "RichProgress"]CODE
LOW…nylane/data/data_manager/progress/_default/__init__.py194__all__ = ["make_progress", "DefaultProgress"]CODE
LOWpennylane/decomposition/decomposition_rule.py431 def set_resources(self, resources: Callable | dict, exact_resources: bool = True) -> None:CODE
LOWpennylane/decomposition/decomposition_rule.py444 def set_work_wire_spec(self, work_wires: Callable | dict) -> None:CODE
LOWpennylane/devices/null_qubit.py47logger = logging.getLogger(__name__)CODE
LOWpennylane/devices/default_mixed.py49logger = logging.getLogger(__name__)STRING
LOWpennylane/devices/_qubit_device.py61logger = logging.getLogger(__name__)CODE
LOWpennylane/devices/default_qubit.py69logger = logging.getLogger(__name__)CODE
LOWpennylane/devices/qubit/adjoint_jacobian.py32logger = logging.getLogger(__name__)CODE
LOWpennylane/devices/qubit/simulate.py48logger = logging.getLogger(__name__)CODE
Cross-Language Confusion9 hits · 36 pts
SeverityFileLineSnippetContext
HIGHtests/data/attributes/operator/test__wires.py40 ([0, 1, None], "[0, 1, null]"),CODE
HIGHtests/data/attributes/operator/test__wires.py41 (["a", 1, None], '["a", 1, null]'),CODE
HIGHpennylane/capture/autograph/ag_primitives.py104 """Assert that none of the results are undefined, i.e. have no value."""STRING
HIGHpennylane/capture/autograph/ag_primitives.py377 JAX and Python. It checks if any of the arguments are undefined, and raises an error if so.STRING
HIGHpennylane/capture/autograph/ag_primitives.py392 operation between two values, `a` and `b`. If either value is undefined, it raises an error."""STRING
HIGHpennylane/capture/autograph/ag_primitives.py398 operation between two values, `a` and `b`. If either value is undefined, it raises an error."""STRING
HIGHpennylane/capture/autograph/ag_primitives.py404 operation on a value `a`. If `a` is undefined, it raises an error."""STRING
HIGHpennylane/data/attributes/serialization.py68 b'["builtins.list",null,[["builtins.dict",["a"],[null]],null]]'STRING
HIGHpennylane/data/attributes/serialization.py96 >>> pytree_structure_load('["builtins.list",null,[["builtins.dict",["a"],[null]],null]')STRING
Structural Annotation Overuse27 hits · 35 pts
SeverityFileLineSnippetContext
LOWpennylane/labs/estimator_beta/templates/state_prep.py404 # Step 1: Prepare the condensed stateSTRING
LOWpennylane/labs/estimator_beta/templates/state_prep.py419 # Step 2: Use QROM to load v_bits into system registerSTRING
LOWpennylane/labs/estimator_beta/templates/state_prep.py444 # Step 5: Use identification register to uncompute the enumeration registerSTRING
LOWpennylane/liealg/horizontal_cartan_subalgebra.py49 # Step 1: Find the span of aCOMMENT
LOWpennylane/liealg/horizontal_cartan_subalgebra.py57 # Step 2: Project each vector in m onto the orthogonal complement of span(a)COMMENT
LOWpennylane/liealg/horizontal_cartan_subalgebra.py63 # Step 3: Find a basis for the non-zero projectionsCOMMENT
LOWpennylane/estimator/ops/op_math/symbolic.py152 # NOTE: This method is not called by the estimate function.STRING
LOWpennylane/estimator/ops/op_math/symbolic.py354 # NOTE: This method is not called by the estimate function.STRING
LOWpennylane/estimator/ops/op_math/symbolic.py542 # NOTE: This method is not called by the estimate function.STRING
LOWpennylane/ftqc/pauli_tracker.py322 # Step 1: Commutate the recorded xz with the Clifford gate to a new xz.STRING
LOWpennylane/ftqc/pauli_tracker.py325 # Step 2: Merge the new xz with the byproduct by_opSTRING
LOWpennylane/qchem/factorization.py824 ) # Step 1: Reduce norm of two-body termSTRING
LOWpennylane/qchem/factorization.py833 ) # Step 2: Reduce norm of one-body termSTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py213 # Step 5: Map the set N to N', containing the components that are spanned bySTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py321 # Step 3: brute-force search of a single vector w_1COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py327 # Step 4: Split the set of bitstrings into three sets:COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py339 # Step 6: Brute-force search bitstring ell to replace v_l. Step 5 is included in _find_ellCOMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py342 # Step 7: Compute new set sub_bits <> \mathcal{V}' of bitstrings in span of bits_basis[:, :-1]COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py349 # Step 8: Append the replacement vector w_t to sub_WCOMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py622 # Step 1: Construct a basis for the input bitsSTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py1061 # Step 1: Dense state preparation in enumeration registerCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py496 # Step 5: Assign bijection for states already in subspaceCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py768 # Step 1: Dense state preparationCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py777 # Step 2: Apply the inverse of the isometry circuitCOMMENT
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py43 # Step 1: The first rho_dim indices are the original state indicesSTRING
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py46 # Step 2: construct the indices for the Kraus operators. Note that the indices here are not necessarily consecutive STRING
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py56 # Step 3: contruct the new indices for the quantum state after the operationSTRING
Verbosity Indicators25 hits · 34 pts
SeverityFileLineSnippetContext
LOWpennylane/labs/estimator_beta/templates/state_prep.py404 # Step 1: Prepare the condensed stateSTRING
LOWpennylane/labs/estimator_beta/templates/state_prep.py419 # Step 2: Use QROM to load v_bits into system registerSTRING
LOWpennylane/labs/estimator_beta/templates/state_prep.py444 # Step 5: Use identification register to uncompute the enumeration registerSTRING
LOWpennylane/liealg/horizontal_cartan_subalgebra.py49 # Step 1: Find the span of aCOMMENT
LOWpennylane/liealg/horizontal_cartan_subalgebra.py57 # Step 2: Project each vector in m onto the orthogonal complement of span(a)COMMENT
LOWpennylane/liealg/horizontal_cartan_subalgebra.py63 # Step 3: Find a basis for the non-zero projectionsCOMMENT
LOWpennylane/io/qasm_interpreter.py522 The purpose of this function is to pass each node to the appropriate handler.STRING
LOWpennylane/ftqc/pauli_tracker.py322 # Step 1: Commutate the recorded xz with the Clifford gate to a new xz.STRING
LOWpennylane/ftqc/pauli_tracker.py325 # Step 2: Merge the new xz with the byproduct by_opSTRING
LOWpennylane/qchem/factorization.py824 ) # Step 1: Reduce norm of two-body termSTRING
LOWpennylane/qchem/factorization.py833 ) # Step 2: Reduce norm of one-body termSTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py213 # Step 5: Map the set N to N', containing the components that are spanned bySTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py321 # Step 3: brute-force search of a single vector w_1COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py327 # Step 4: Split the set of bitstrings into three sets:COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py339 # Step 6: Brute-force search bitstring ell to replace v_l. Step 5 is included in _find_ellCOMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py342 # Step 7: Compute new set sub_bits <> \mathcal{V}' of bitstrings in span of bits_basis[:, :-1]COMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py349 # Step 8: Append the replacement vector w_t to sub_WCOMMENT
LOW…nnylane/templates/state_preparations/sum_of_slaters.py622 # Step 1: Construct a basis for the input bitsSTRING
LOW…nnylane/templates/state_preparations/sum_of_slaters.py1061 # Step 1: Dense state preparation in enumeration registerCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py496 # Step 5: Assign bijection for states already in subspaceCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py768 # Step 1: Dense state preparationCOMMENT
LOWpennylane/templates/state_preparations/partial_unary.py777 # Step 2: Apply the inverse of the isometry circuitCOMMENT
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py43 # Step 1: The first rho_dim indices are the original state indicesSTRING
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py46 # Step 2: construct the indices for the Kraus operators. Note that the indices here are not necessarily consecutive STRING
LOWpennylane/devices/qubit_mixed/einsum_manpulation.py56 # Step 3: contruct the new indices for the quantum state after the operationSTRING
Excessive Try-Catch Wrapping31 hits · 31 pts
SeverityFileLineSnippetContext
LOWtests/ops/op_math/test_composite_op.py273 except Exception as e: # pylint: disable=broad-exceptCODE
LOWtests/ops/op_math/test_composite_op.py283 except Exception as e: # pylint: disable=broad-exceptCODE
LOW.github/workflows/scripts/upload_reports/upload.py43 except Exception as e:CODE
LOWpennylane/kernels/postprocessing.py218 except Exception: # pylint: disable=broad-exceptSTRING
LOWpennylane/kernels/postprocessing.py221 except Exception as e:STRING
LOWpennylane/capture/autograph/ag_primitives.py295 except Exception as e: # pylint: disable=broad-exception-caught,broad-exceptCODE
LOWpennylane/capture/autograph/ag_primitives.py302 except Exception as e: # pylint: disable=broad-exception-caught,broad-exceptCODE
LOWpennylane/capture/autograph/ag_primitives.py325 except Exception as e:CODE
LOWpennylane/io/io.py641 except Exception as e: # pragma: no coverSTRING
LOWpennylane/io/io.py835 except Exception as e:STRING
LOWpennylane/ftqc/utils.py184 except Exception as exc:STRING
LOWpennylane/ftqc/utils.py216 except Exception as exc:STRING
LOWpennylane/math/single_dispatch.py118 except Exception as e:CODE
LOWpennylane/math/matrix_manipulation.py337 except Exception as err: # pragma: no cover, pylint:disable=broad-exceptCODE
LOWpennylane/concurrency/executors/native/multiproc.py66 except Exception as e:STRING
LOWpennylane/noise/conditionals.py237 except Exception as e: # pragma: no coverCODE
LOWpennylane/noise/conditionals.py296 except Exception as e: # pragma: no coverCODE
LOWpennylane/templates/core.py775 except Exception as e:CODE
LOWpennylane/ops/op_math/pow.py285 except Exception as e:CODE
LOWpennylane/ops/op_math/pow.py303 except Exception as e:CODE
MEDIUMpennylane/ops/op_math/pow.py292def decomposition(self):CODE
LOWpennylane/ops/op_math/pow2.py162 except Exception as e:CODE
LOWpennylane/ops/op_math/pow2.py180 except Exception as e:CODE
MEDIUMpennylane/ops/op_math/pow2.py171def compute_decomposition(base, z):CODE
LOWpennylane/ops/functions/assert_valid.py476 except Exception as e:CODE
LOWpennylane/ops/functions/assert_valid.py482 except Exception as e:CODE
LOWpennylane/ops/functions/assert_valid.py565 except Exception as e:CODE
LOWpennylane/control_flow/for_loop.py471 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpennylane/gradients/vjp.py136 except Exception: # pylint: disable=broad-exceptCODE
LOWpennylane/gradients/vjp.py238 except Exception: # pylint: disable=broad-exceptCODE
LOWpennylane/logging/decorators.py36 except Exception as e:CODE
AI Slop Vocabulary13 hits · 15 pts
SeverityFileLineSnippetContext
LOWtests/core/operator/test_core_operator.py261 # because it will simply set `ndim_params` to the ndims of the provided argumentsCOMMENT
LOWtests/pauli/test_pauli_arithmetic.py271 # psx does not contain identity, so simply add it to the definition with pw_idCOMMENT
LOWtests/pauli/test_pauli_arithmetic.py810 # psx does not contain identity, so simply add it to the definition with pw_idCOMMENT
MEDIUMpennylane/operation.py73 """To facilitate StatePrep rename"""STRING
LOWpennylane/core/transforms/transform.py431 # simply return the original function rather thanSTRING
LOWpennylane/core/operator/operator2.py820 # no need for copies if we just use queue methodSTRING
LOWpennylane/core/operator/base.py1247 # no need for copies if we just use queue methodSTRING
MEDIUMpennylane/math/multi_dispatch.py403 # Avoid the case when one is a scalar - using a robust check for scalarsCOMMENT
MEDIUMpennylane/math/__init__.py192 """Subclass of the Autoray NumpyMimic class in order to supportSTRING
MEDIUMpennylane/math/decomposition.py50 # one to find theta, but the most numerically robust approachSTRING
LOWpennylane/transforms/split_non_commuting.py766 # For all other measurement types, simply add them to the list of measurements.STRING
LOWpennylane/ops/op_math/controlled.py1081 # For N>1 control wires, we simply add N-1 control wires to the phase shiftCOMMENT
LOWpennylane/devices/qubit_mixed/apply_operation.py726 # If the operation covers the full system, just return itCOMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHpennylane/devices/qubit/simulate.py457 # either as requested by terminal measurements or post-selectionCOMMENT
Slop Phrases3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/codeql.yml59 # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize howCOMMENT
MEDIUMpennylane/pulse/parametrized_evolution.py282 As discussed above, the ODE solver will evaluate the Schrodinger equation atCODE
LOWpennylane/control_flow/_loop_abstract_axes.py58 # so therefore we just need to make sure to clean up after ourselves afterCOMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/shadow/test_shadow_class.py431 # TODO: add tests for the gradient once we implement the post-processing reconstructionCOMMENT
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/workflow/test_marker.py39 def test_function(self):CODE
LOWtests/ops/op_math/test_adjoint.py1000 def test_function(self):CODE
Fake / Example Data1 hit · 0 pts
SeverityFileLineSnippetContext
LOWpennylane/core/transforms/__init__.py25 """placeholder"""STRING