Skip to content
/ sqc Public

A simple digital quantum computer simulator

License

Notifications You must be signed in to change notification settings

lehner/sqc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sqc

This repository contains a simple digital quantum computer simulator. Its main purpose is to illustrate concepts introduced in an accompanying lecture on quantum computing.

As an example, creating an entangled Bell state and performing ten classical measurements can be done by the simple code

import sqc

Nbits=2

# Create Bell state
s=sqc.operator(Nbits).H(0).CNOT(0,1) * sqc.state(Nbits)

# Print state
print("Bell state")
print(s)

# Perform 10 measurements
for n in range(10):
    s0,v0=s.measure(0)
    s1,v1=s0.measure(1)

    # And print results of state and classical bits
    print("Measurement # %d: %s | %d%d" % (n,s1,v1,v0))

About

A simple digital quantum computer simulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages