Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an option to print out instructions in the null device #1316

Open
jay-selby opened this issue Nov 19, 2024 · 0 comments
Open

Implement an option to print out instructions in the null device #1316

jay-selby opened this issue Nov 19, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@jay-selby
Copy link
Contributor

Context

The PennyLane plugin should have an Boolean option print_instructions (other names can also be proposed) with a default False value. This option must forwarded to the C++ device constructor.

In the runtime plugin, the QuantumDevice should be able to print out the following instructions when the option is set to true:

  • Qubits:
    • AllocateQubit/AllocateQubits
    • ReleaseQubit/ReleaseAllQubits
  • Gates:
    • NamedOperation
    • MatrixOperation
    • Measure
  • Measurement process:
    • Expval
    • Var
    • State
    • Probs/PartialProbs
    • Sample/PartialSample
    • Counts/PartialCounts

The format should be kept as simple as possible while providing the necessary information (numerical parameters, wires, control wires, control values, adjoint), for example:

H(0)
RY(0.5, wires=0)
C(Z(1), control=[2, 3, 4])
Adjoint(Y(0))

Observables should be printed as part of the measurement process, not upon their construction, for example:

Expval(Y(0))
Var(Z(0) x (Y(1))
Sample(wires=[0, 1, 2], shots=100)

Installation help

Complete instructions to install Catalyst from source can be found here. Note that due to the size of the llvm-project it can take a while (~3 hrs on a personal laptop) to compile.

@paul0403 paul0403 added the good first issue Good for newcomers label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants