ORNL-QCI / tnqvm

Tensor Network QPU Simulator for Eclipse XACC
43 stars 10 forks source link

TNQVMVisitor Interface #11

Closed amccaskey closed 4 years ago

amccaskey commented 7 years ago

We need a top-level interface, called TNQVMVisitor, that extends AllGateVisitor, but also provides an initialize() and finalize() method.

Initializing the wavefunction tensor, and other init functionality, can go in initialize. In finalize(), I'd like to see ITensorMPSVisitor take its cbits from Measurements and add them to the AcceleratorBuffer so that users can call getMeasurements() and view the measurement results.

Then in execute() we'll wrap the InstructionIterator loop with visitor->initialize() and visitor->finalize().

I'd also like to see the tnqvm/ directory restructured to have TNQVM, TNQVMBuffer, and TNQVMVisitor classes only, and subdirectories itensor/ and exatensor/ that hold visitors specific to those types.

amccaskey commented 7 years ago

@mileschen360 This is a pretty easy task to pick off if you want. If not, just let me know, I'll take care of it.