Skip to content

Commit

Permalink
Small fix for an overly aggressive warning (#6707)
Browse files Browse the repository at this point in the history
**Context:**
Was raising a warning too aggressively.

**Description of the Change:**
Small change to make sure using numpy with autograd/jax doesn't raise a
warning.

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**
  • Loading branch information
austingmhuang authored Dec 16, 2024
1 parent 056dd9a commit cffa08a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ such as `shots`, `rng` and `prng_key`.

* Added JAX support for the differentiable Hartree-Fock workflow.
[(#6096)](https://github.com/PennyLaneAI/pennylane/pull/6096)
[(#6707)](https://github.com/PennyLaneAI/pennylane/pull/6707)

* Added functions and dunder methods to add and multiply Resources objects in series and in parallel.
[(#6567)](https://github.com/PennyLaneAI/pennylane/pull/6567)
Expand Down
11 changes: 10 additions & 1 deletion pennylane/qchem/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ def __init__(
for i, c in enumerate(coeff)
]

if len(set(qml.math.get_deep_interface(x) for x in [coordinates, alpha, coeff])) > 1:
if (
len(
{
qml.math.get_deep_interface(x)
for x in [coordinates, alpha, coeff]
if qml.math.get_deep_interface(x) != "numpy"
}
)
> 1
):
warnings.warn(
"The parameters coordinates, coeff, and alpha are not of the same interface. Please use the same interface for all 3 or there may be unintended behavior.",
UserWarning,
Expand Down

0 comments on commit cffa08a

Please sign in to comment.