cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

[Python] [tests] Chemistry tests rely on prebuilt kernels

Open khalatepradnya opened this issue 7 months ago • 0 comments

  • The function cudaq.__clearKernelRegistries() causes the global kernel registry to be cleared. As a result, the kernels in python/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.

khalatepradnya avatar Jul 17 '24 21:07 khalatepradnya