PCVL-1273 adapt algorithms to new workflow - #776
Conversation
| @@ -0,0 +1,77 @@ | |||
| # MIT License | |||
There was a problem hiding this comment.
"retro" is french. "Backward compatibility"
| @@ -0,0 +1,101 @@ | |||
| # MIT License | |||
There was a problem hiding this comment.
"BackwardCompatibility" or more specific "ProcessorCompatibility"
| super().__init__(processor, **kwargs) | ||
| self._sampler = Sampler(processor, **kwargs) | ||
| super().__init__(computer, **kwargs) | ||
| self._experiment = experiment # Make a copy ? |
There was a problem hiding this comment.
It depends whether the different methods assume that the underlying experiement remains the same.
As there is only one public method compute(), it seems a valid usecase to change the experiment while keeping the Analyzer
There was a problem hiding this comment.
The problem is that compute() stores the results inside the Analyzer, and is called automatically when asking for the distribution property. Changing the experiment after calling compute will not change the results if someone asks the distribution, but it will if compute() has not been called before
| def __init__(self, processor: AProcessor, **kwargs): | ||
| self._processor = processor | ||
| def __init__(self, computer: AbstractComputer, **kwargs): | ||
| # TODO: remove (deprecated since 1.3) |
There was a problem hiding this comment.
So we have to update notebooks too
There was a problem hiding this comment.
The goal was to keep the Sampler as it is since we are going to drop it
| p.with_input(input_state) | ||
| e.with_input(input_state) | ||
|
|
||
| parameters = tomography_experiment._computer.parameters | {"compute_physical_logical_perf": True} |
There was a problem hiding this comment.
For dictionaries, this is a union (a | b is equivalent to {**a, **b}, but more readable)
| # TODO: remove this file when removing the Processor support | ||
|
|
||
| def computer_from_processor(processor: AProcessor) -> AbstractComputer: | ||
| # This method is a quick patch for places where a Processor is needed. |
There was a problem hiding this comment.
This method is a quick patch for places where a Processor is needed.
This baseline should be adapted to specific cases when needed
No description provided.