Skip to content

[QI2-1505] Reorganise for expanded topology #31

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

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions schemas/get_static/reply_success.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,8 @@
"type": "integer"
},
"topology": {
"description": "List of the edges between the various qubits",
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
],
"type": "array"
},
"title": "Topology",
"type": "array"
"$ref": "#/$defs/Topology",
"description": "List of the edges between the various qubits"
},
"name": {
"description": "Name of the system.",
Expand Down Expand Up @@ -141,6 +127,24 @@
],
"title": "QuantumHardwareStaticData",
"type": "object"
},
"Topology": {
"description": "A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.",
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
],
"type": "array"
},
"title": "Topology",
"type": "array"
}
},
"description": "The reply containing system information for 2300.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class TopologyItem(RootModel[List]):
root: List = Field(..., max_length=2, min_length=2)


class Topology(RootModel[List[TopologyItem]]):
root: List[TopologyItem] = Field(
...,
description='A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.',
title='Topology',
)


class CompilerConfig(BaseModel):
decomposition: Optional[List[CompilerPass]] = Field([], title='Decomposition')
mapping: Optional[List[CompilerPass]] = Field([], title='Mapping')
Expand All @@ -39,10 +47,8 @@ class CompilerConfig(BaseModel):

class QuantumHardwareStaticData(BaseModel):
nqubits: int = Field(..., description='The number of qubits.', title='Nqubits')
topology: List[TopologyItem] = Field(
...,
description='List of the edges between the various qubits',
title='Topology',
topology: Topology = Field(
..., description='List of the edges between the various qubits'
)
name: str = Field(..., description='Name of the system.', title='Name')
pgs: List[str] = Field(
Expand Down