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

NIGSC changes #318

Merged
merged 22 commits into from
May 3, 2023
Merged

NIGSC changes #318

merged 22 commits into from
May 3, 2023

Conversation

vodovozovaliza
Copy link
Contributor

@vodovozovaliza vodovozovaliza commented Apr 29, 2023

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

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

Thanks @vodovozovaliza for implementing this.
I started with a quick a review even if this is still in draft.
I agree with the changes proposed by this PR.
You can find below a few comments.

src/qibocal/calibrations/niGSC/basics/experiment.py Outdated Show resolved Hide resolved
@@ -41,7 +39,7 @@ def test_abstract_factory():
cfactory = CircuitFactory(1, [1, 2] * 3, qubits=[0])
with pytest.raises(NotImplementedError):
for circuit in cfactory:
print(circuit.draw())
circuit.draw()
Copy link
Contributor

Choose a reason for hiding this comment

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

This could probably be removed I think

src/qibocal/calibrations/niGSC/basics/circuitfactory.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Merging #318 (12e587b) into simplify_builder (8b1402e) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           simplify_builder     #318   +/-   ##
=================================================
  Coverage             38.04%   38.04%           
=================================================
  Files                    42       42           
  Lines                  2802     2802           
=================================================
  Hits                   1066     1066           
  Misses                 1736     1736           
Flag Coverage Δ
unittests 38.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@vodovozovaliza vodovozovaliza marked this pull request as ready for review May 1, 2023 09:35
@vodovozovaliza
Copy link
Contributor Author

@andrea-pasquale @wilkensJ this is ready for review

src/qibocal/calibrations/niGSC/basics/circuitfactory.py Outdated Show resolved Hide resolved
Comment on lines 57 to 60
circuit_init_kwargs = deepcopy(circuit.init_kwargs)
del circuit_init_kwargs["nqubits"]
bigcircuit = Circuit(self.nqubits, **circuit_init_kwargs)
bigcircuit.add(circuit.on_qubits(*self.qubits))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is clearer? I think that I is just a different taste, right?

circuit_init_kwargs = deepcopy(circuit.init_kwargs)
circuit_init_kwargs['nqubits'] = self.nqubits

bigcircuit = models.Circuit(**circuit.init_kwargs)

bigcircuit.add(circuit.on_qubits(*self.qubits))

src/qibocal/calibrations/niGSC/basics/plot.py Outdated Show resolved Hide resolved
)
)
fig_traces.append(
go.Scatter(
x=x_fit,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to put the fitting parameters in the label of the fit? If there are more than 2 plots I think the graphic is easier to read and to interact with.

@@ -137,13 +134,14 @@ def post_processing_sequential(experiment: Experiment):
# After the row by row execution of tasks comes the aggregational task. Something like calculation
# of means, deviations, fitting data, tasks where the whole data as to be looked at, and not just
# one instance of circuit + other information.
def get_aggregational_data(experiment: Experiment) -> pd.DataFrame:
def get_aggregational_data(experiment: Experiment, ndecays: int = 2) -> pd.DataFrame:
Copy link
Contributor

@wilkensJ wilkensJ May 2, 2023

Choose a reason for hiding this comment

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

How can the number of decays be changed through a runcard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This parameter is not used in the runcards for now, but can be used to redo the fitting of the same experiment

Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

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

Thanks @vodovozovaliza.
You can find below a few comments.
I think that we should be able to merge this PR today.

src/qibocal/calibrations/niGSC/basics/experiment.py Outdated Show resolved Hide resolved
src/qibocal/calibrations/niGSC/basics/experiment.py Outdated Show resolved Hide resolved
src/qibocal/calibrations/niGSC/basics/experiment.py Outdated Show resolved Hide resolved
src/qibocal/calibrations/niGSC/basics/experiment.py Outdated Show resolved Hide resolved
src/qibocal/calibrations/niGSC/basics/plot.py Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

This modifications also affect the report generated by the low level routines.
Moving the table to the left is not ideal for the routine which include more than one plot.
I believe this is out of the scope of this PR, we could discuss about the report generation in a separate PR/issue.

Copy link
Contributor

@wilkensJ wilkensJ May 3, 2023

Choose a reason for hiding this comment

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

I tried it with the routines from runcard/actions_qq.yml (a simulation) and for me it looked fine, the only change here is that it is not centered anymore and there is a bit of more whitespace between the columns.
It would be nice if you could try to generate reports with the new css settings and if something is not readable anymore I totally agree to not implement that.
Otherwise, when the table has only a 30% width our fitting parameters are in two lines and that does influence how they are read, also, it takes a lot of space, so if there are more than lets say 5 lines the breaking does make it harder to read. The 50% was as a bit arbitrary, maybe 40% would also do that, or the margin to the left can be more, that was also more of a try and error, I am very open for new ideas here.

I totally agree though that the centered looks more nice:
Bildschirmfoto 2023-05-03 um 09 51 06
But it does not do any harm if it is not centered anymore:
Bildschirmfoto 2023-05-03 um 09 50 57

With our report:
Bildschirmfoto 2023-05-03 um 09 56 50
vs
Bildschirmfoto 2023-05-03 um 09 57 29

Copy link
Contributor

Choose a reason for hiding this comment

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

I have a problem only with the position of the table.
If you run for example t1 with dummy it looks like this:
image
which personally I don't like. As you said centered looks better.
I also understand that the current rendering may not best for the RB protocols.
For single plot you could try to stretch out the plot like we do for the T1 above.
For multiple plots I think that the table in the center should look ok.
But, again we could fix this in a separate PR and we should also ask the opinion of other people.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree! This looks weird. I like the idea of putting it in another PR :)

@wilkensJ
Copy link
Contributor

wilkensJ commented May 3, 2023

For me this would be fine to merge with the simply_builder now :)

Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @vodovozovaliza.

@andrea-pasquale andrea-pasquale merged commit 4277bad into simplify_builder May 3, 2023
@andrea-pasquale andrea-pasquale deleted the nigsc_changes branch May 3, 2023 12:05
@andrea-pasquale andrea-pasquale mentioned this pull request May 3, 2023
8 tasks
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.

3 participants