Skip to content

PCVL-1273 adapt algorithms to new workflow - #776

Open
Aubaert wants to merge 3 commits into
Quandela:developfrom
Aubaert:PCVL-1273-adapt-algorithms-to-new-workflow
Open

PCVL-1273 adapt algorithms to new workflow#776
Aubaert wants to merge 3 commits into
Quandela:developfrom
Aubaert:PCVL-1273-adapt-algorithms-to-new-workflow

Conversation

@Aubaert

@Aubaert Aubaert commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@@ -0,0 +1,77 @@
# MIT License

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"retro" is french. "Backward compatibility"

@@ -0,0 +1,101 @@
# MIT License

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"BackwardCompatibility" or more specific "ProcessorCompatibility"

super().__init__(processor, **kwargs)
self._sampler = Sampler(processor, **kwargs)
super().__init__(computer, **kwargs)
self._experiment = experiment # Make a copy ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we have to update notebooks too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

| -> or?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This method is a quick patch for places where a Processor is needed.
This baseline should be adapted to specific cases when needed

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