qiskit-advocate / qiskit-advocate-projects

A repository of projects that Qiskit Advocates are actively working on. This project has been evolved into Qiskit Advocate Mentorship Program (QAMP) and the repo is archived. See QAMP Spring 21 for example.
https://github.com/qiskit-advocate/qamp-spring-21
13 stars 2 forks source link

Haskell Implementation of MicroQiskit #11

Open aditya-giri opened 4 years ago

aditya-giri commented 4 years ago

Abstract

This is a Haskell implementation of James Wootton's MicroQiskit, aimed at providing a functional programming interface to MicroQiskit.

Description

We have to start from scratch. We need to first complete the following steps:

Finally we have to figure out how to port the jobs to python-compatible code.

Members

Deliverable

A Haskell library implementing MicroQiskit.

Github repo

Repo: https://github.com/aditya-giri/MicroQiskit Branch: haskell

e-eight commented 4 years ago

From Junye: project details are added to the issue.

icepolarizer commented 4 years ago

Brilliant! 🎉

e-eight commented 4 years ago

If you want to contribute, but are new to Haskell, here are a few resources to learn it "quickly".

http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/ http://learnyouahaskell.com/ http://shuklan.com/haskell/index.html

icepolarizer commented 4 years ago

Nice. I used Haskell a bit...a long time ago, but I forgot most of them. I'll use these resources to reboot my memories.

aditya-giri commented 4 years ago

There's also this book that I like. You'll find it on libgen.

spencerking commented 4 years ago

I'd like to help out as well. I think this will require a bit more upfront planning than the other implementations since it's a completely different paradigm.

HuangJunye commented 4 years ago

I just got to know about Haskell when I started learning Rust a few days ago to work on project #4 . The only thing I know about Haskell is that it's not object oriented language but a functional language. But there is already a C implementation of MicroQiskit so I assume it won't be that different.

e-eight commented 4 years ago

There's also this book that I like. You'll find it on libgen.

That’s a great book too! And they keep on updating it.

e-eight commented 4 years ago

I just got to know about Haskell when I started learning Rust a few days ago to work on project #4 . The only thing I know about Haskell is that it's not object oriented language but a functional language. But there is already a C implementation of MicroQiskit so I assume it won't be that different.

Functional programming is very different from imperative programming. In the C/C++ ecosphere only thing that would be similar to a functional programming language is template metaprogramming in C++. That being said, it is possible to write imperative style code in Haskell, so the end result could be similar.

aditya-giri commented 4 years ago

A lot of languages including Python are functional too, just not purely functional like Haskell is. Imperative style code in Haskell is generally frowned upon but you do see some use-cases occasionally. I think this will be good fun! :D

aditya-giri commented 4 years ago

What do you guys think is the best way to get familiar enough with Haskell? Reading a book like the one I linked above could take ages, but learnyouhaskell is probably the most convenient for now?

e-eight commented 4 years ago

Yes that is over 1000 pages in its latest incarnation. You could follow this. https://github.com/bitemyapp/learnhaskell (just the first course) or this https://crypto.stanford.edu/~blynn/haskell/. Followed by this https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours. I am planning to do the last one over a weekend or something. That should be enough to get started, and then we learn as we progress in the project.

icepolarizer commented 4 years ago

For now, I think Haskell the Hard Way seems to work best for me. Quick and dense.

icepolarizer commented 4 years ago

@HuangJunye By the way, I'd like to suggest updating the Members section in project details. We have four assignees, but there's only two in the list.

aditya-giri commented 4 years ago

One last resource share: https://www.youtube.com/channel/UC3xdLFFsqG701QAyGJIPT1g

aditya-giri commented 4 years ago

Can we decide on a date to regroup after getting a little familiar with Haskell?

e-eight commented 4 years ago

Does a week sound fair?

aditya-giri commented 4 years ago

I'm gonna need a little longer, I'd prefer 2 weeks. What about the others?

icepolarizer commented 4 years ago

Two weeks seems legit for me :)

icepolarizer commented 4 years ago

Also, I think the conversion of OOP -> FP will be the most challenging part for us. To be honest, it seems impossible to completely copy the architecture of MicroQiskit, because it's completely OOP based. We have to think more in-depth about imitating them.

aditya-giri commented 4 years ago

You're right, we will have to give it some thought. It's alright if it takes time, as long as we do a good job... (Also, we can set up a private channel on slack once we start so we don't have to discuss everything here)

icepolarizer commented 4 years ago

Agreed! I'll make one. And I think the name should be 'functional-microqiskit', because it might be a good idea to make Qiskit for other FP languages once we complete the theorem of FP-styled Qiskit.

icepolarizer commented 4 years ago

Looks like I can't make another channel in Qiskit slack. @HuangJunye could you please help?

HuangJunye commented 4 years ago

@MonolithPenguin Done! Love the enthusiasm of this team!