Giter Site home page Giter Site logo

nerator / matr2scheme Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 122 KB

algorithm for decomposition of arbitrary unitary matrix into product of two-level matrices

License: GNU General Public License v3.0

Scala 100.00%
quantum-computing matrix-decompositions

matr2scheme's Introduction

Build Status

matr2scheme

Overview

Implementation of the algorithm for decomposition of arbitrary unitaty matrix into product of two-level matrices. The algorithm is described in books "Quantum Computation and Quantum Information" by Michael Nilsen and Isaac Chang (4.5.1 Two-level unitary gates are universal) and "Quantum computing : from linear algebra to physical realizations" by Mikio Nakahara and Tetsuo Ohmi (4.6 Universal Quantum Gates).

Building

For Scala 2.13.1:

sbt ++2.13.1 packageVer

For Scala 2.12.11:

sbt ++2.12.11 packageVer

For Scala 2.11.12:

sbt ++2.11.12 packageVer

Resulting zip-files will be located at package folder.

Usage

Unzip archive with required Scala version to use. If you use Java 8 or later, use 2.13 or 2.12 version. Otherwise stick to 2.11.

Running (Linux):

./matr2scheme <filename>

Running (Windows):

matr2scheme.bat <filename>

filename should be text file with unitary matrix. Complex numbers entered like (Re,Im). For more info run matr2scheme without parameters.

matr2scheme's People

Contributors

klntsky avatar nerator avatar

Stargazers

 avatar  avatar

Watchers

 avatar

matr2scheme's Issues

Program crashes with eye matrix as an input

matrix2.txt:

1  0  0  0  
0  1  0  0  
0  0  1  0  
0  0  0  1 

running:

$ ./matr2scheme ../matrix2.txt 
Программа для разложения унитарной матрицы на произведение двухуровневых матриц.
Автор: Довжиков Сергей

Исходная матрица:
1  0  0  0  
0  1  0  0  
0  0  1  0  
0  0  0  1  

Результат (по Нильсен, Чанг):
Проверка равенства произведения матриц исходной:
Exception in thread "main" java.lang.UnsupportedOperationException: empty.reduceLeft
	at scala.collection.LinearSeqOptimized.reduceLeft(LinearSeqOptimized.scala:139)
	at scala.collection.LinearSeqOptimized.reduceLeft$(LinearSeqOptimized.scala:138)
	at scala.collection.immutable.List.reduceLeft(List.scala:89)
	at scala.collection.TraversableOnce.reduce(TraversableOnce.scala:211)
	at scala.collection.TraversableOnce.reduce$(TraversableOnce.scala:211)
	at scala.collection.AbstractTraversable.reduce(Traversable.scala:108)
	at quant.tools.Runner$.runAlg(Runner.scala:42)
	at quant.tools.Runner$.$anonfun$new$2(Runner.scala:102)
	at quant.tools.Runner$.$anonfun$new$2$adapted(Runner.scala:102)
	at scala.util.Either.fold(Either.scala:191)
	at quant.tools.Runner$.delayedEndpoint$quant$tools$Runner$1(Runner.scala:102)
	at quant.tools.Runner$delayedInit$body.apply(Runner.scala:14)
	at scala.Function0.apply$mcV$sp(Function0.scala:39)
	at scala.Function0.apply$mcV$sp$(Function0.scala:39)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
	at scala.App.$anonfun$main$1$adapted(App.scala:80)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.App.main(App.scala:80)
	at scala.App.main$(App.scala:78)
	at quant.tools.Runner$.main(Runner.scala:14)
	at quant.tools.Runner.main(Runner.scala)

Scala 2.13.0

  • scala-reflect
  • scala-library
  • scala-compiler

  • breeze
  • scala-parser-combinators
  • scalatest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.