cuda-quantum
cuda-quantum copied to clipboard
[Python] [tests] Chemistry tests rely on prebuilt kernels
-
The function
cudaq.__clearKernelRegistries()
causes the global kernel registry to be cleared. As a result, the kernels inpython/cudaq/kernels/uccsd.py
get cleared. -
If
python/tests/domains/test_chemistry.py
is run after this, then it fails -
FAILED ../python/tests/domains/test_chemistry.py::testUCCSD - cudaq.kernel.ast_bridge.CompilerError: uccsd.py:537: error: unhandled function call - single_excitation, known kernels are dict_keys([])
(offending source -> single_excitation(qubits, singles_a[i][0], singles_a[i][1], thetas[thetaCounter]))
FAILED ../python/tests/domains/test_chemistry.py::test_uccsd_kernel - cudaq.kernel.ast_bridge.CompilerError: uccsd.py:579: error: unhandled function call - uccsd_even_electrons, known kernels are dict_keys([])
(offending source -> uccsd_even_electrons(qubits, thetas, n_electrons, n_qubits))
- Expected behavior - the kernels get recompiled.