https://github.com/qcsim/qcsim

A quantum computer simulation research project

https://github.com/qcsim/qcsim

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.2%) to scientific vocabulary

Keywords

go golang physics qcsim quantum-computing simulation
Last synced: 6 months ago · JSON representation

Repository

A quantum computer simulation research project

Basic Info
  • Host: GitHub
  • Owner: qcsim
  • License: 0bsd
  • Language: Go
  • Default Branch: main
  • Homepage:
  • Size: 99.6 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 4
Topics
go golang physics qcsim quantum-computing simulation
Created 11 months ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

Quantum Computer Simulation

This is a quantum computer simulation research project. It's probably not accurate to a real quantum computer.

Build instructions

You'll need to have Go installed.

sh git clone https://github.com/qcsim/qcsim.git && cd qcsim go run .

Usage

You should start by creating new qubits:

```go import ( "math/cmplx"

"github.com/qcsim/qcsim/qubit"

)

func main() { q0 := qubit.New(1/cmplx.Sqrt(2), 1/cmplx.Sqrt(2)) q1 := qubit.New(1, 0) q2 := qubit.New(0, 1) } ```

Then you can initialise a computer with those qubits:

```go import ( // ...

"github.com/qcsim/qcsim/computer"

)

func main() { // ...

qc := computer.New([]qubit.Qubit{q0, q1, q2})

} ```

This will add your qubits to the computer in the order that you put them in the array. After this, you can use array indexing to apply operations to the qubits in the computer, using the gates you have available:

  • PauliX
  • PauliY
  • PauliZ
  • Hadamard
  • Phase
  • PiBy8
  • ControlledNot
  • ControlledZ
  • Swap
  • Toffoli

For example:

```go func main() { // ...

if err := qc.Hadamard(0); err != nil {
    slog.Error("Error performing Hadamard", "error", err)
}
if err := qc.PauliX(0); err != nil {
    slog.Error("Error performing Pauli X", "error", err)
}
if err := qc.PauliX(1); err != nil {
    slog.Error("Error performing Pauli X", "error", err)
}
if err := qc.Toffoli(0, 1, 2); err != nil {
    slog.Error("Error performing Toffoli", "error", err)
}

} ```

Once you're done, you can output the state of the system using Measure:

```go func main() { // ...

var measureCount uint = 100000
fmt.Println(qc.Measure(measureCount))

} ```

If the measure count is 1, then simply the state of the system will be returned, but if it is greater than 1, then a table with the state and its corresponding count will be returned.

Owner

  • Name: QCSim
  • Login: qcsim
  • Kind: organization

A quantum computer simulation research project

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Delete event: 2
  • Push event: 6
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Delete event: 2
  • Push event: 6

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: 7 days
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 7 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • noClaps (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
proxy.golang.org: github.com/qcsim/qcsim
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 7 months ago