Skip to main content

stabgraph

Every stabilizer state can be transformed into a graph state by means of a local Clifford unitary. stabgraph is contains the function convert that, given a stabilizer state, it finds such a graph state and the local Clifford unitary that transforms the stabilizer state into the graph state. This function follows the steps described in the article [1].

[1] Manuscript under preparation.

Installation

To install using pip:

python -m pip install --upgrade pip
python -m pip install stabgraph

Replace python with python3 as appropriate.

Usage

import stabgraph

G , c , t , z , R = stabgraph.convert(stabs,control=None,target=None,shuffle=False) 

INPUT

stabs contains the N stabilizer operators defining a stabilizer state of N qubits. It is a list of N strings 'PPPP...', one for each stabilizer operator. Every string has N elements 'P' from the set 'I', 'X', 'Y', 'Z', that represents the set of Pauli matrices.

OPTIONAL INPUTS

control is a list of control qubits. Gives the option to set some qubits as control qubits. Qubits are labelled from 0 to N-1. It is an empy list by default.

target is a list of target qubits. Gives the option to set some qubits as target qubits. Qubits are labelled from 0 to N-1. It is an empty list by default.

shuffle can be set to be True. For a given stabilizer state there are multiple local Clifford equivalent graph states that can be obtained by this program. If shuffle=True the output graph is one of these graphs chosen randomly. shuffle=False by default.

OUTPUTS

G adjacency matrix defining the underlying graph of the graph state. It is a NxN numpy array composed by 0 and 1.

c list of control qubits labelled from 0 to N-1. The program completes the list of control qubits given as an input.

t list of target qubits labelled from 0 to N-1. The program completes the list of target qubits given as an input. A Hadamard gate is applied on every target qubit.

z list of control qubits labelled from 0 to N-1 where a pi/2 z-rotation is applied.

R invertible binary matrix representing the recombination of stabilizers performed to obtain the stabilizers of the graph state. It is a NxN numpy array composed of 0 and 1.

EXAMPLES

Bell pair

>>> stabs = ['XX','ZZ']
>>> G , c , t , z , R = stabgraph.convert(stabs)
>>> G
np.array([[0,1],[1,0]])
>>> c
[0]
>>> t
[1]
>>> z
[]
>>> R
np.array([[1,0],[0,1]])

GHZ state fixing 0 as a control qubit and 1 as a target qubit

>>> stabs = ['XXX','ZZI','IZZ']
>>> G , c , t , z , R = stabgraph.convert(stabs,[0],[1])
>>> c
[0]
>>> t
[1,2]

Steane code in the |0> logical state. Multiple graphs can be obtained, so put shuffle=True to obtain one of them randomly chosen. The result respects the selection of control and target qubits

>>> stabs = ['XXXXIII','IXXIXXI','IIXXIXX','ZZZZIII','IZZIZZI','IIZZIZZ','ZZZZZZZ']
>>> G , c , t , z , R = stabgraph.convert(stabs, control = [0], shuffle=True)
>>> c
[0,1,2]
>>> G , c , t , z , R = stabgraph.convert(stabs, control = [2, 5], shuffle=True)
>>> c
[2,5,6]

Citation

@article{amaro2019,
  author = 	"David Amaro and Markus Müller and Amit Kumar Pal",
  title = 	"Scalable characterization of localizable entanglement in noisy topological quantum codes",
  year = 	"2019",
  month =   "July"
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stabgraph-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stabgraph-0.1.1-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file stabgraph-0.1.1.tar.gz.

File metadata

  • Download URL: stabgraph-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for stabgraph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c8346c7160cc7debe1e865815d017a419249ca157099d76e0d561128a880549a
MD5 6d13329b4cc2b26d97207cbba99d6ba8
BLAKE2b-256 d5a839297c8fdbbd649478edfa94c67d152a8f8025ad633e39f1677ca8cd4d23

See more details on using hashes here.

File details

Details for the file stabgraph-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: stabgraph-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for stabgraph-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e37112991fbf1a657a8a39839c6b58d1f9f075e371cf03c69e467e5afbb6ee3b
MD5 a2afcc9b96bac257eba5e86a7024f0e2
BLAKE2b-256 f2d3592bb10706c5aff1cae7137eabe2d8c98fd6022c42838c0667beefa2777f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page