lifecycle tutorial#782
Conversation
|
Hi Nathan, More examples is always more better, thanks very much for this! 🎉 However, doesn't it only meaningfully differ from the existing applyHadamard(qureg, 0);
applyPauliX(qureg, 1); |
|
The main contribution would be the comments. Maybe I can consolidate with |
|
That sounds better, but I note that I usually shy from redundant comments, like // Initialise QuEST
initQuESTEnv();
// Create a qureg
Qureg qureg = createQureg(25);
// Apply some operators
applyHadamard(qureg);
// Finalise the QuEST environment.
finalizeQuESTEnv();Such comments are just visual noise when the API function describes precisely what is happening. I much prefer "why" comments, which explain the broader context, as you can see a nice example of here. Replacing the comments with just the maths doesn't seem worthwhile - it's not a HPC simulator example's job to teach the reader what the Hadamard gate does! I think |
|
Right right. I mainly did it for myself whilst reading the preprint to translate notation into code. Let me dig a little deeper and see if I can cook something up. |
Added a simple tutorial showing a lightweight entry-point example for new users who want to see the standard QuEST workflow in one small file before exploring more advanced examples.
i.e.,
examples/tutorials/min_lifecycle_example.cshows the basic flow of a small QuEST simulation:QuregKept this intentionally minimal and with elaborate comments, did not modify the existing CMake configuration. If preferred, I can follow up by wiring this into the
examplesbuild system.