Skip to content

y-richie-y/ap-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AP form simulator

Very basic Clifford state simulator using AP form in ~ 100 loc, written for (my) educational purposes.

image

Clifford states can be expressed as a list of projectors onto an affine subspace $A$ over $\mathbb{F}^n_2$, transformed by a quadratic phase polynomial $\phi(\vec{x})$.

You can read more about them in the Picturing Quantum Software book.

Example

from state import APState

APState(3).s(0).h(1).cx(0, 1).cz(0, 2).vec()
# APState(n_qubits=3, projectors=set(), phases4=[3, 3, 3], czs={CZ({1, 2}), CZ({0, 1}), CZ({0, 2})})
# array([ 0.5+0.j ,  0. +0.j ,  0. +0.j ,  0. +0.5j,  0.5+0.j ,  0. +0.j ,
#        0. +0.j , -0. -0.5j])

About

Very basic Clifford state simulator using AP form in ~ 100 loc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages