tfq.datasets.excited_cluster_states
Stay organized with collections
Save and categorize content based on your preferences.
Return a tuple of potentially excited cluster states and their labels.
tfq . datasets . excited_cluster_states (
qubits
)
For every qubit in qubits
this method will create a cluster state circuit
on qubits
, apply a cirq.X
on that qubit along with a label of 1 and add
it to the return dataset. Finally a cluster state circuit on qubits
that
doesn't contain any cirq.X
gates with a label of -1 will be added to the
returned dataset.
Note: This is a toy dataset that can serve as guidance for the community
to contribute new datasets to TensorFlow Quantum.
circuits , labels = tfq . datasets . excited_cluster_states (
cirq . GridQubit . rect ( 1 , 3 )
)
print ( circuits [ 0 ])
( 0 , 0 ): ─── H ─── @ ─────── @ ─── X ───
│ │
( 0 , 1 ): ─── H ─── @ ─── @ ───┼───────
│ │
( 0 , 2 ): ─── H ─────── @ ─── @ ───────
labels [ 0 ]
1
print ( circuits [ - 1 ])
( 0 , 0 ): ─── H ─── @ ─────── @ ───
│ │
( 0 , 1 ): ─── H ─── @ ─── @ ───┼───
│ │
( 0 , 2 ): ─── H ─────── @ ─── @ ───
labels [ - 1 ]
- 1
Circuits that feature a cirq.X
gate on one of the qubits are labeled 1,
while the circuit that doesn't feature a cirq.X
anywhere has the label -1.
Args
qubits
Python list
of cirq.GridQubit
s on which the excited cluster
state dataset will be created.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-17 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-05-17 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-17 UTC."],[],[]]