Skip to content

Conversation

1tnguyen
Copy link
Collaborator

Description

(1) Allow override in registerDeviceKernel

(2) Clear kernel decorator's module (parsed from walking the Python AST) as we switch target.
The lack of this module attribute tells the decorator to perform a proper compile().

Note: Other global maps might be populated during kernel constructor (i.e., as Python sees kernels); hence might not be safe to clear.

(3) Python to honor the default simulator environment variable for hardware target emulation. It was hardcoded to qpp for those targets that don't define a simulator.

}
target.platformName = foundPlatformName.value_or("default");
target.simulatorName = foundSimulatorName.value_or("qpp");
target.simulatorName = foundSimulatorName.value_or("");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the default won't be qpp simulator anymore? Just curious to know what would the default option be?

target.simulatorName, target.platformName);
std::string simName = target.simulatorName;
if (simName.empty()) {
// This target doesn't a simulator defined, e.g., hardware targets.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: doesn't have a

if (simName.empty()) {
// This target doesn't a simulator defined, e.g., hardware targets.
// We still need a simulator in case of local emulation.
auto &defaultTargetInfo = targets[defaultTarget];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Here is the default simulator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, without this, we're stuck with qpp for all hardware emulation when running on Python, e.g., cannot use stim for emulation of Clifford circuits.

github-actions bot pushed a commit that referenced this pull request Oct 10, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants