Skip to content

Solving bugs in qubit_crosstalk routine#1327

Draft
lballerio wants to merge 1 commit into
mainfrom
crosstalk_bugfix
Draft

Solving bugs in qubit_crosstalk routine#1327
lballerio wants to merge 1 commit into
mainfrom
crosstalk_bugfix

Conversation

@lballerio

@lballerio lballerio commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

this PR aims to solve two bugs in qubit_crosstalk routine:

	    flux_crosstalk = e.qubit_crosstalk(bias_point={"B1": 0.0},
	                                        targets=["B1", "B2"],
											flux_qubits=None 
											...)
  1. if bias_point dictionary does not contain bias point for every target qubit _fit routine crashes since it is taking this dictionary as input for fitting., and a KeyError is given. I solved this bug by simply inserting default values for the missing qubits, i.e. the sweetspot in the calibration.json file of the platform. See fill_bias_points method.

  2. if no list of qubits to flux (flux_qubits param) is given, the following error: TypeError: 'NoneType' object is not iterable arose because the params was not correctly configured. Hence we wrote drop_targets function for solving this issue: if no flux_qubit is given the function takes all qubits but the target ones.

Important

Bug n.2 needs also the Qibolab PR #1350 to be merged, otherwise the routine will still give error (not related to the ones reported here)

…tform calibration.json) if no bias point is given in the parameter.
@codecov

codecov Bot commented Dec 24, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.80%. Comparing base (155ad3b) to head (323bebe).

Files with missing lines Patch % Lines
...bocal/protocols/flux_dependence/qubit_crosstalk.py 81.81% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1327      +/-   ##
==========================================
- Coverage   97.83%   97.80%   -0.04%     
==========================================
  Files         132      132              
  Lines       10041    10049       +8     
==========================================
+ Hits         9824     9828       +4     
- Misses        217      221       +4     
Flag Coverage Δ
unittests 97.80% <81.81%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
...bocal/protocols/flux_dependence/qubit_crosstalk.py 97.05% <81.81%> (-1.38%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lballerio lballerio requested a review from alecandido December 24, 2025 10:46
@lballerio lballerio marked this pull request as ready for review December 24, 2025 10:46
@lballerio lballerio marked this pull request as draft December 24, 2025 10:47
"""Return all qubits of a given QPU except the ones we want to target in crosstalk routine"""
return [q for q in qpu_platform.qubits.keys() if q not in target_list]


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.

@alecandido should we put drop_targets as a method of QubitCrosstalkParameters class?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is an option, but not a mandatory one.

In particular, the call itself

    flux_qubits = (
        drop_targets(targets, platform)
        if params.flux_qubits is None
        else params.flux_qubits
    )

is quite related to the class.
But the content of drop_targets() is completely unrelated, since it is not making use of any information which is in the class.

Since, for the time being, it is meant to be used only internally (to this module), just prepend a _, to make it clear it is not intended for import. I.e. _drop_targets().

There are more or less three levels for top-level variables:

  • internal (to the module), which are _-prefixed
  • internal (to the qibocal package), just do nothing
  • public (for qibocal users), which should be listed in __all__

@lballerio lballerio marked this pull request as ready for review December 24, 2025 13:24
@lballerio lballerio marked this pull request as draft December 24, 2025 13:26
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