Skip to content
Closed
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
169 changes: 169 additions & 0 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"id": "9e9313ca-e8e1-4615-913f-cdf261c483e7",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"<svg viewBox=\"0 0 288 224\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<g id=\"qubit_lines\">\n",
"<path id=\"qubit_line:0\" d=\"M64,64 L256,64 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"64\">q0</text>\n",
"<path id=\"qubit_line:1\" d=\"M64,128 L256,128 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"128\">q1</text>\n",
"</g>\n",
"<rect x=\"80\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"white\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"96\" y=\"64\">H</text>\n",
"<path d=\"M160,64 L160,128 \" stroke=\"black\"/>\n",
"<circle cx=\"160\" cy=\"64\" r=\"12\" stroke=\"none\" fill=\"black\"/>\n",
"<circle cx=\"160\" cy=\"128\" r=\"12\" stroke=\"black\" fill=\"white\"/>\n",
"<path d=\"M148,128 L172,128 M160,116 L160,140 \" stroke=\"black\"/>\n",
"<rect x=\"208\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"64\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"44\">rec[0]</text>\n",
"<rect x=\"208\" y=\"112\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"128\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"108\">rec[1]</text>\n",
"</svg>"
],
"text/plain": [
"<__main__.C at 0x7fe46673f4a0>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"class C:\n",
" def _repr_svg_(self):\n",
" return \"\"\"\n",
"<svg viewBox=\"0 0 288 224\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<g id=\"qubit_lines\">\n",
"<path id=\"qubit_line:0\" d=\"M64,64 L256,64 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"64\">q0</text>\n",
"<path id=\"qubit_line:1\" d=\"M64,128 L256,128 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"128\">q1</text>\n",
"</g>\n",
"<rect x=\"80\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"white\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"96\" y=\"64\">H</text>\n",
"<path d=\"M160,64 L160,128 \" stroke=\"black\"/>\n",
"<circle cx=\"160\" cy=\"64\" r=\"12\" stroke=\"none\" fill=\"black\"/>\n",
"<circle cx=\"160\" cy=\"128\" r=\"12\" stroke=\"black\" fill=\"white\"/>\n",
"<path d=\"M148,128 L172,128 M160,116 L160,140 \" stroke=\"black\"/>\n",
"<rect x=\"208\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"64\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"44\">rec[0]</text>\n",
"<rect x=\"208\" y=\"112\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"128\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"108\">rec[1]</text>\n",
"</svg>\"\"\"\n",
"\n",
"C()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "594f6731-3b78-4ea5-bb86-7fae2ea8e097",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"<svg viewBox=\"0 0 288 224\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<g id=\"qubit_lines\">\n",
"<path id=\"qubit_line:0\" d=\"M64,64 L256,64 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"64\">q0</text>\n",
"<path id=\"qubit_line:1\" d=\"M64,128 L256,128 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"128\">q1</text>\n",
"</g>\n",
"<rect x=\"80\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"white\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"96\" y=\"64\">H</text>\n",
"<path d=\"M160,64 L160,128 \" stroke=\"black\"/>\n",
"<circle cx=\"160\" cy=\"64\" r=\"12\" stroke=\"none\" fill=\"black\"/>\n",
"<circle cx=\"160\" cy=\"128\" r=\"12\" stroke=\"black\" fill=\"white\"/>\n",
"<path d=\"M148,128 L172,128 M160,116 L160,140 \" stroke=\"black\"/>\n",
"<rect x=\"208\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"64\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"44\">rec[0]</text>\n",
"<rect x=\"208\" y=\"112\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"128\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"108\">rec[1]</text>\n",
"</svg>"
],
"text/plain": [
"<__main__.C at 0x7fe466794770>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"class C:\n",
" def _repr_svg_(self):\n",
" return \"\"\"\n",
"<svg viewBox=\"0 0 288 224\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<g id=\"qubit_lines\">\n",
"<path id=\"qubit_line:0\" d=\"M64,64 L256,64 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"64\">q0</text>\n",
"<path id=\"qubit_line:1\" d=\"M64,128 L256,128 \" stroke=\"black\"/>\n",
"<text dominant-baseline=\"central\" text-anchor=\"end\" font-family=\"monospace\" font-size=\"12\" x=\"64\" y=\"128\">q1</text>\n",
"</g>\n",
"<rect x=\"80\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"white\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"96\" y=\"64\">H</text>\n",
"<path d=\"M160,64 L160,128 \" stroke=\"black\"/>\n",
"<circle cx=\"160\" cy=\"64\" r=\"12\" stroke=\"none\" fill=\"black\"/>\n",
"<circle cx=\"160\" cy=\"128\" r=\"12\" stroke=\"black\" fill=\"white\"/>\n",
"<path d=\"M148,128 L172,128 M160,116 L160,140 \" stroke=\"black\"/>\n",
"<rect x=\"208\" y=\"48\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"64\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"44\">rec[0]</text>\n",
"<rect x=\"208\" y=\"112\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"black\"/>\n",
"<text dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"30\" x=\"224\" y=\"128\" fill=\"white\">M</text>\n",
"<text text-anchor=\"middle\" font-family=\"monospace\" font-size=\"8\" x=\"224\" y=\"108\">rec[1]</text>\n",
"</svg>\"\"\"\n",
"\n",
"C()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "834615c6-e56b-4027-a118-0cd47fdbfbac",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading