qibocal.protocols.two_qubit_interaction.cross_resonance package¶
Submodules¶
qibocal.protocols.two_qubit_interaction.cross_resonance.cancellation_amplitude module¶
Hamiltonian tomography protocol for CR gate calibration.
This protocol computes the expectation values for X, Y and Z for the target qubit after the application of a cross resonance sequence. The CR pulses are played on the control drive channel with frequency set to the frequency of the target drive channel.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cancellation_amplitude.cancellation_amplitude_tuning = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)¶
HamiltonianTomographyCANCAmpl Protocol object.
qibocal.protocols.two_qubit_interaction.cross_resonance.cancellation_phase module¶
Hamiltonian tomography protocol for CR gate calibration.
This protocol computes the expectation values for X, Y and Z for the target qubit after the application of a cross resonance sequence. The CR pulses are played on the control drive channel with frequency set to the frequency of the target drive channel.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cancellation_phase.cancellation_phase_tuning = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)¶
HamiltonianTomographyCANCPhase Protocol object.
qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes module¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyType = dtype([('prob_target', '<f8'), ('error_target', '<f8'), ('prob_control', '<f8'), ('error_control', '<f8'), ('x', '<f8')])¶
Custom dtype for Hamiltonian Tomography.
- exception qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.OverlappingQubitPairError[source]¶
Bases:
ExceptionRaised when the target qubit pairs are not independent.
- add_note()¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.check_qubit_overlap(targets: list[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]]) None[source]¶
This function checks if the input qubit pairs are independent, i.e. they don’t share any qubit.
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
-
Helper to create sequence with control set to X or I.
- Id = 'Id'¶
- X = 'X'¶
- encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- replace(old, new, count=-1, /)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- split(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- rsplit(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold()¶
Return a version of the string suitable for caseless comparisons.
- title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub[, start[, end]]) int¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
- expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- index(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower()¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rfind(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper()¶
Return a copy of the string converted to uppercase.
- startswith(prefix[, start[, end]]) bool¶
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
- endswith(suffix[, start[, end]]) bool¶
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- format(*args, **kwargs) str¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.Basis(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
-
Measurement basis.
- X = 'X'¶
- Y = 'Y'¶
- Z = 'Z'¶
- encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- replace(old, new, count=-1, /)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- split(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- rsplit(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold()¶
Return a version of the string suitable for caseless comparisons.
- title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub[, start[, end]]) int¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
- expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- index(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower()¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rfind(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper()¶
Return a copy of the string converted to uppercase.
- startswith(prefix[, start[, end]]) bool¶
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
- endswith(suffix[, start[, end]]) bool¶
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- format(*args, **kwargs) str¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
-
Hamiltonian terms for CR effective Hamiltonian.
- IX = 'IX'¶
- IY = 'IY'¶
- IZ = 'IZ'¶
- ZX = 'ZX'¶
- ZY = 'ZY'¶
- ZZ = 'ZZ'¶
- encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- replace(old, new, count=-1, /)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- split(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- rsplit(sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold()¶
Return a version of the string suitable for caseless comparisons.
- title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub[, start[, end]]) int¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
- expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- index(sub[, start[, end]]) int¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower()¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rfind(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(sub[, start[, end]]) int¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper()¶
Return a copy of the string converted to uppercase.
- startswith(prefix[, start[, end]]) bool¶
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
- endswith(suffix[, start[, end]]) bool¶
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- format(*args, **kwargs) str¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyParameters(duration_range: tuple[float, float, float], echo: bool = False, interpolated_sweeper: bool = False)[source]¶
Bases:
ParametersParent class for parameters in all time-sweeping hamiltonian tomography experiments.
- echo: bool = False¶
Apply echo sequence or not.
The ECR is described in https://arxiv.org/pdf/1210.7011
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyResults(echo: bool, cr_lengths: dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], float] = <factory>, hamiltonian_terms: dict = <factory>, fitted_parameters: dict = <factory>)[source]¶
Bases:
ResultsResults for Hamiltonian Tomography CR Length experiment.
- cr_lengths: dict[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], float]¶
Estimated durations of CR gate.
- class qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyData(echo: bool, data: dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.Basis, ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl], ~typing.Any] = <factory>)[source]¶
Bases:
DataData for Hamiltonian Tomography CR Amplitude experiment.
- _to_npz(path: Path, filename: str)¶
Helper function to use np.savez while converting keys into strings.
- property qubits: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]¶
Access qubits from data structure.
- register_qubit(dtype, data_keys, data_dict)¶
Store output for single qubit.
- data: dict[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Basis, SetControl], Any]¶
Raw data acquired.
- property pairs¶
Access qubit pairs from data structure.
qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_amplitude module¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_amplitude.cr_amplitude = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=True)¶
Hamiltonian tomography protocol for CR gate calibration.
This protocol computes the expectation values for X, Y and Z for the target qubit after the application of a cross resonance sequence. The CR pulses are played on the control drive channel with frequency set to the frequency of the target drive channel. We repeat the measurement twice for each target qubit, once with the control qubit in state 0 and once with the control qubit in state 1.
qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_length module¶
Hamiltonian tomography protocol for CR gate calibration.
This protocol computes the expectation values for X, Y and Z for the target qubit after the application of a cross resonance sequence. The CR pulses are played on the control drive channel with frequency set to the frequency of the target drive channel.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_length.cr_length = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=True)¶
HamiltonianTomographyCRLength Protocol object.
We measure the expectation values X,Y and Z on the target qubit after applying the CR sequence specified by the input parameters. We repeat the measurement twice for each target qubit, once with the control qubit in state 0 and once with the control qubit in state 1.
Check http://login.qrccluster.com:9000/u7Xw0C4_Rti6s2JdJ_HI4g== for a good experiment result found on emulator with 1% of classical crosstalk between the two qubits.
qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing module¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.dynamic_evolution_optimizer(signals_id: ndarray[tuple[Any, ...], dtype[_ScalarT]], x: ndarray[tuple[Any, ...], dtype[_ScalarT]], init_omega_guess: float, use_constraints: bool = False) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Optimizer for sinusoidal fitting; it exploits evolution algorithm to find the best fit parameters. This algorithm is a gradient-free optimization, hence might be less affected by local minima in the cost function landscape, but it can be computationally expensive, especially for large datasets or complex models.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.scipy_curve_fit_optimizer(concatenated_signal: ndarray[tuple[Any, ...], dtype[_ScalarT]], vector_x: ndarray[tuple[Any, ...], dtype[_ScalarT]], init_omega_guess: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Optimizer for sinusoidal fitting; it exploits gradient-based algorithms to find the best fit parameters. This algorithm is a gradient-base optimization, hence might be affected by local minima in the cost function landscape when dealing with sinusoidal functions due to their periodicity.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.numerical_root_finder(root_func: Callable[[...], float], x_range: ndarray[tuple[Any, ...], dtype[_ScalarT]] | list[float], tol: float, **kwargs)[source]¶
Finds the root of a generic function
root_funcby minimizing its absolute value.The solver first performs a coarse grid search across the provided range to identify a starting candidate, then refines the result using the Nelder-Mead simplex algorithm; then, if the search is successful, the algorithm returns the value where the function is closest to zero. This function minimizes abs(root_func(x)). If the function does not cross zero, it will return the local minimum of the absolute value.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.compute_total_expectation_value(data: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyData, pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]) tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]¶
Given a Qubit Pair :data:`pair`=(control, target), it computes the expectation values for each Pauli Basis for the target and control qubits respectively.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.bloch_func(x: list[float] | ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fitted_parameters: dict) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Given the fitted parameters for the target’s Pauli expectation values for either control qubit in |0> or in |1>, computes the estimated Bloch vector.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.compute_bloch_vector(data: HamiltonianTomographyCRLengthData | HamiltonianTomographyCRAmplData, pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fitted_parameters: dict | None = None) tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], ndarray[tuple[Any, ...], dtype[_ScalarT]] | None, ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]¶
For a given qubit pair
pair, it computes the Bloch vector R for each data point and also estimates the Bloch vector using the fitted parameters of the Hamiltonian Tomography. See arXiv:1603.04821 for further information.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.estimate_cr_param(x_range: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], data: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyData, pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fitted_parameters: dict, tol: float = 1e-06) float[source]¶
Function for estimating important parameters for the cross resonance, depending on the specific experiment run; if
datais typeHamiltonianTomographyDatait finds the thuned pulse duration, while ifdatais typeHamiltonianTomographyCRAmplDatait finds the tuned pulse amplitude.The cross resonance parameter is computed by finding the value that solves the Bloch vector R. To do so, the function checks whether all the fits in the Hamiltonian Tomography experiment succeeded; if so the Bloch vector is computed by using the fitted parameter, otherwise it simply computes R only for the acquired datapoints.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.tune_cancellation_sequence(x: list[float] | ndarray[tuple[Any, ...], dtype[_ScalarT]], function_to_tune: Callable[[...], float], interactions_to_analyze: list[HamiltonianTerm], ham_term: dict, fit_params: dict, tuned_keys: list[str], tol: float) dict[str, float][source]¶
Function for estimating parameters for the cancellation pulse sequence, depending on the specific experiment (either pulses phase tuning or cancellation amplitude tuning).
The specific parameter is computed by finding the value that solves an input function
function_to_tune. To do so, the function checks whether all the fits in the Hamiltonian Tomography experiment succeeded; if so roots are solved by using the fitted parameter, otherwise it simply computesfunction_to_tuneonly for the acquired datapoints and the closest value to 0 is selected.These parameters are computed for every term of the Cross Resonance Hamiltonian: IX, ZX, IY, ZY, IZ, ZZ and saved into a dictionary.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.estimate_cancellation_amplitudes(amplitudes: list[float] | ndarray[tuple[Any, ...], dtype[_ScalarT]], ham_term: dict, ampl_params: dict, tol: float = 1e-08) dict[str, float][source]¶
Extrapolates the cancellation pulse amplitude for the cross resonance pulse sequence.
This function estimates the optimal amplitudes for cancelling unwanted Hamiltonian terms (IX and IY) in the cross resonance pulse sequence. It uses linear fitting to determine the amplitude values that minimize these interaction terms.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.estimate_cr_phases(phases: list[float] | ndarray[tuple[Any, ...], dtype[_ScalarT]], ham_term: dict, phase_params: dict, tol: float = 1e-06) tuple[float, float][source]¶
Extrapolates the cancellation pulse phases for the cross resonance pulse sequence.
This function estimates the optimal phases for cancelling unwanted Hamiltonian terms (ZY and IY) in the cross resonance pulse sequence. It uses sinusoidal fitting to determine the phase values that minimize these interaction terms.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.tomography_cr_fit(data: HamiltonianTomographyData, fit_with_evolution: bool = False) tuple[dict[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], SetControl], list[float]], dict[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], float]][source]¶
Fit Hamiltonian tomography data for cross-resonance gates.
This function performs sinusoidal fitting on tomography data collected for cross-resonance interactions between qubit pairs. It fits the measurement probabilities in X, Y, and Z bases across different control settings.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.extract_hamiltonian_terms(pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fitted_parameters: dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl], list[float]]) dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, float]][source]¶
Extract Hamiltonian terms from fitted parameters.
We follow the procedure presented in the paper https://arxiv.org/pdf/2303.01427.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.refactor_hamiltonian_terms(ham_terms: dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm], float], pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]) dict[HamiltonianTerm, float][source]¶
Refactor Hamiltonian terms by removing qubit pair information from keys.
Converts dictionary keys from (qubit_id_0, qubit_id_1, HamiltonianTerm) tuples to just HamiltonianTerm, simplifying the data structure.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.reconstruct_full_hamiltonian_terms(ham_terms: dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, float], pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]) dict[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], HamiltonianTerm], float][source]¶
Reconstruct full Hamiltonian terms dictionary by adding qubit pair information to keys.
Converts dictionary keys from HamiltonianTerm to (qubit_id_0, qubit_id_1, HamiltonianTerm) tuples, restoring the original data structure used for Hamiltonian terms.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.amp_tom_fit(x: list[float] | ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], y: list[float] | ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], q_pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], term: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, result_dict: dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, dict[str, float]]) dict[HamiltonianTerm, dict[str, float]][source]¶
Fit linear function to amplitude vs Hamiltonian term data.
Performs a linear fit on the provided data to extract amplitude-dependent parameters for a specific Hamiltonian term.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.cancellation_amplitude_fit(data: HamiltonianTomographyData) tuple[dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], list[tuple[float, dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, float]]]], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, dict[str, float]]], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[str, float]], dict[float, dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl], list[float]]], dict[float, dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], float]]][source]¶
Perform amplitude-dependent tomography fitting for calibrating cross resonance cancellation pulse.
Fits the dependence of Hamiltonian term parameters on the CR pulse amplitude. Extracts Hamiltonian terms at different amplitudes and fits their variation with amplitude to obtain linear parameters and cancellation amplitudes.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.phase_tom_fit(x: list[float] | ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], y: list[float] | ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]], q_pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], term: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, result_dict: dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, dict[str, float]]) dict[HamiltonianTerm, dict[str, float]][source]¶
Fit sinusoidal function to phase vs Hamiltonian term data.
Performs a sinusoidal fit on the provided data to extract phase-dependent parameters for a specific Hamiltonian term.
- qibocal.protocols.two_qubit_interaction.cross_resonance.cross_resonance_processing.cancellation_phase_fit(data: HamiltonianTomographyData) tuple[dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], list[tuple[float, dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, float]]]], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTerm, dict[str, float]]], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[str, float]], dict[float, dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl], list[float]]], dict[float, dict[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], float]]][source]¶
Fit phase-dependent Hamiltonian parameters using cross-resonance tomography.
Extracts and fits Hamiltonian terms for different phases across all qubit pairs, performing sinusoidal fits on phase-dependent data and estimating cancelling phases for control and target qubits.
qibocal.protocols.two_qubit_interaction.cross_resonance.fitting module¶
Fitting function for CR tomography.
- qibocal.protocols.two_qubit_interaction.cross_resonance.fitting.pauli_z_expectation(t: ndarray[tuple[Any, ...], dtype[_ScalarT]], wx: float, wy: float, wz: float, gamma: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Pauli Z expectation value for CR tomography.
See https://arxiv.org/pdf/2303.01427 Eq. S10.
- qibocal.protocols.two_qubit_interaction.cross_resonance.fitting.pauli_x_expectation(t: ndarray[tuple[Any, ...], dtype[_ScalarT]], wx: float, wy: float, wz: float, gamma: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Pauli X expectation value for CR tomography.
See https://arxiv.org/pdf/2303.01427 Eq. S10.
- qibocal.protocols.two_qubit_interaction.cross_resonance.fitting.pauli_y_expectation(t: ndarray[tuple[Any, ...], dtype[_ScalarT]], wx: float, wy: float, wz: float, gamma: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Pauli Y expectation value for CR tomography.
See https://arxiv.org/pdf/2303.01427 Eq. S10.
- qibocal.protocols.two_qubit_interaction.cross_resonance.fitting.vectorized_simultaneous_expectation(t: ndarray[tuple[Any, ...], dtype[_ScalarT]], wx: float, wy: float, wz: float, gamma: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.fitting.simultaneous_expectation(t: ndarray[tuple[Any, ...], dtype[_ScalarT]], wx: float, wy: float, wz: float, gamma: float) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]¶
Simulateneous computation for X, Y and Z expectation values.
We also constrain w to be the norm of the w vector with component wx, wy, wz. See https://arxiv.org/pdf/2303.01427 Eq. S10.
qibocal.protocols.two_qubit_interaction.cross_resonance.plotting module¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.plotting.tomography_cr_plot(data: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyData, target: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fit: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyResults | None = None) tuple[list[Figure], str][source]¶
Create cross-resonance Hamiltonian tomography plots given the acquired data and the fit results for to a pair of qubits.
- qibocal.protocols.two_qubit_interaction.cross_resonance.plotting.cancellation_calibration_plot(data: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyData, target: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fit: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.HamiltonianTomographyResults | None = None) tuple[list[Figure], str][source]¶
Plot calibration results for cross-resonance Hamiltonian tomography when tuning cancellation pulses.
Generates plots for either amplitude or phase calibration data of cancellation pulses in cross-resonance interactions. Fits effective Hamiltonian terms and visualizes the results with fitted curves overlaid on experimental data.
qibocal.protocols.two_qubit_interaction.cross_resonance.utils module¶
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.cross_resonance_pulses(platform: CalibrationPlatform, control: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) tuple[Pulse | None, Pulse | None][source]¶
Retrieve cross-resonance (CR) pulse parameters from platform calibration. This function extracts the CR pulse and its corresponding cancellation pulse from the platform’s native gates configuration for a given control-target qubit pair.
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.ro_delay_range(cr_pulse_duration_range: tuple[float, float, float], echo: bool, cntl_setup: SetControl, control: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], platform: Platform) tuple[float, float, float][source]¶
Delay range for RO pulses.
add the number of the pi-pulses if we are in echo mode or if we want to set the control to 1. num_cr_pulses is the number of cross resonance pulses: == 1 if there is no echo sequence == 2 if there is echo sequence num_pi_pulses is the number of pi-pulses: == 0 if there is no echo and control at 0 == 1 if there is no echo and control at 1 == 2 if there is echo and control at 0 == 3 if there is echo and control at 1
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.cross_res_sequence(platform: Platform, control: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], duration: float, control_amplitude: float, control_phase: float, target_amplitude: float | None, target_phase: float, echo: bool, interpolated_sweeper: bool = False) tuple[PulseSequence, list[Pulse], list[Pulse], list[Delay]][source]¶
Creates sequence for CR experiment on
controlandtargetqubits.With
setupit is possible to set the control qubit to 1 or keep it at 0. Ifechois set toTruea ECR gate will be played. Withbasisit is possible to set the measurement basis. If it is not provided the default is Z.
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.appending_ro_sequence(platform: Platform, control: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], exp_sequence: PulseSequence, basis: Basis, interpolated_sweeper: bool) tuple[PulseSequence, list[Delay]][source]¶
Append a readout pulse sequence for two qubits with a specified delay.
This function constructs a pulse sequence that applies readout operations to both control and target qubits with an initial delay on each readout channel.
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.cross_resonance_experiment(platform: ~qibolab._core.platform.platform.Platform, pair_list: list[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]], duration: float | dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], float], ctrl_ampl: float | dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], float], ctrl_phase: float | dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], float], targ_ampl: float | dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], float | None] | None, targ_phase: float | dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], float], basis: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.Basis, setup: ~qibocal.protocols.two_qubit_interaction.cross_resonance.cr_parent_classes.SetControl, echo: bool = False, interpolated_sweeper: bool = False) tuple[~qibolab._core.sequence.PulseSequence, dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], ~qibolab._core.pulses.pulse.Pulse], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], ~qibolab._core.pulses.pulse.Pulse], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], ~qibolab._core.pulses.pulse.Delay], dict[~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], ~qibolab._core.pulses.pulse.Delay]][source]¶
Build the pulse sequence for a cross-resonance experiment.
The sequence is created for one or more control-target qubit pairs. The control qubit can be prepared in either |0> or |1> depending on
setup. Ifechois True, an echoed cross-resonance sequence is generated. The target measurement basis is selected withbasis.
- qibocal.protocols.two_qubit_interaction.cross_resonance.utils.update_cnot_from_fit(platform: ~qibocal.calibration.platform.CalibrationPlatform, pair: ~typing.Annotated[tuple[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], cr_duration: float, cr_ampl: float, control_phase: float, canc_ampl: float | None, canc_phase: float, echo_flag: bool) None[source]¶
Update CNOT gate calibration from cross-resonance fit parameters.
Constructs and updates the CNOT gate using cross-resonance pulses with fitted parameters, including single-qubit rotations and virtual Z phases.