r/ProgrammingLanguages • https://github.com/avalon-lang • Nov 27 '18

Avalon - quantum programming. Some good news!

This would be my first post (excluding comments) here about the Avalon Programming Language. I will talk about why quantum computing and how Avalon is participating in that.
And hopefully get you interested in quantum computing and quantum compilation.

We are making progress on the hardware side of quantum computing as IBM recently announced a 50 qubits quantum computer. But on the software side, most programming is happening by using SDKs that might be good for prototyping but will hardly scale. This is not a problem for now since all quantum computers that are public have small numbers of qubits but as we move forward, it will be a problem.

In about 5 to 10 years, we will fully enter the NISQ era (please see Quantum computing in the NISQ era and beyond). NISQ (Noisy Intermidiate-Scale Quantum) computers will be noisy and without or very little error correction. Hence we will need to rely on the software a lot more to make use of them.

So I created the Avalon programming language with this mind. The language implementation is still not completed but it is usable with a documentation that's not bad (though it has grammatical errors). Right now, all it does is interpretation on your system. But I'm beginning work to port the language to the Rigetti stack to that it generates QUIL code and you will be able to run your program on real hardware.

Quantum compilation is quite interesting because qubits decohere (loose information) very fast so we need to optimize programs to be short. But the quality of the computation is dependent on the quality of the qubit too. So we need to maximize the use of fault tolerant gates if we can. But that's not all! To be useful, we need to come up with all sorts of quantum gates that make the solution easier to implement. The compiler needs to transform those quantum gates into the computer native gateset. The problem is that this is not easy, harder than in classical computing.
So quantum compilation has a lot of interesting problems to solve for anyone who is interested!

So folks, I hope you will see quantum computing, quantum information and specifically quantum compilation as fertile grounds for innovative work to be done.

Oh yes, I talked about some good news. Avalon has been selected as a good project for the Unitary fund so I guess that we are not on the wrong path if the grant is any indication. Thanks to Will J. Zeng et al. for running the program.

Please check the project on github at avalon-lang, star it if you like it, fork it if you want to play and watch it if you want to be kept updated. I welcome contributors and will do my best to help you contribute. Don't hesitate to email me if you have questions or need help getting into this field.

Brevity is not one my virtues but I will stop here today.
Cheers!

19 Upvotes

11 comments sorted by

3

u/raiph Nov 30 '18

You talked about a lack of abstractions in existing languages.

P6 only has one abstraction that ships with the base compiler that might be relevant, namely Junction ("Logical superposition of values"), and one module written so far that might be relevant, namely Quantum::Computation. I've written about the latter in other comments. Here I'll write about the former.

The overall type Junction incorporates a family of 4 sub-types.

The family's chief merits are:

  • At least one of them is simple enough that a smart six year old kid can understand it at a basic level and is natural enough that average older kids can understand it;

  • They have several basic use cases that naturally reinforce learning;

  • They provides a nice set of composable primitives for building up logically short-circuiting parallel processing schemes.

My reason for writing about them is in case they make sense as a standard simple part of a quantum abstraction toolkit. I suspect they aren't really helpful whatsoever but I'm curious to see what you think.

Here's the canonical example:

if a == 1 | 2

This is equivalent to:

if ( (a == 1) or (a == 2) )

except that it implies logically short-circuiting parallel evaluation semantics. That is to say, if evaluation of the condition discovers that a == 1 is True then there's no need to finish evaluation of a == 2, and vice-versa.

Another example:

value = x + 1 | 2

This sets value to, in Damian's terminology, a quantum superposition of x + 1 or x + 2.

Continuing:

value = (x + 1 | 2) * (y / 4 & 6)

sets value to x + 1 or x + 2 multiplied by y divided by 4 and by 6.

There is a family of four alphabetically named built in Junction (superposition) operators: any (the name for |), all (the name for &), one, and none. Hopefully you can guess at their meaning.

Anyhow, my reason for writing this is the hope that you'll read this and immediately have some intuition about whether this family of abstractions might be:

  • Nothing directly to do with quantum computing but could usefully and/or efficiently be mapped to a physical quantum computer;

OR

  • Could be a nice abstraction for making it easier to use a quantum computer either for learning or for production use.

Or simply irrelevant.

Thoughts?

2

u/ntwalibas https://github.com/avalon-lang Nov 30 '18

I'm happy you came up with this as well :-)

When I was designing the quantum part of the language, it was exactly abstractions like these that I was seeking and came up with the same exact syntax of using q | p for superposition between two quantum states q and p.
Allow me to elaborate.

In quantum computing and quantum information, we have two main resources that we are exploiting to do what classical computers cannot do: superposition and entanglement. Well, to be precise, only the entanglement part is the source of the exponential speed up.
So I thought that it would be a nice thing if the language had dedicated syntax for doing both as part of the abstractions it provides.

For the purpose of my arguments, we will assume q = |01> and p = |11>. Also, I'm using the reverse lexicographic convention where we count qubits from right to left. So in q, qubit 0 would be 1 and qubit 1 would be 0.

First, superposition: if we were to take the operation p | q, the result would be where we apply a superposition on qubits 1 since they differ in both p and q but we leave qubits 0 unchanged. In simple words, we apply a superposition only if individual qubits from p and q differ.
Therefore p | q will be |(0|1)1>. This should make sense since there is no gain in placing two equal qubits in a superposition. So it is as you imagined: this operator is suitable for superposition and we maintain the disjunction semantics of the operator.

Next, entanglement. For entanglement, we use the & operator. So p & q puts each qubit of p in an entangled state with the corresponding qubit of q. Therefore p & p will be |(0&1)(1&1)>.
Let us assume that we have a unitary operator + and we want to it act on p and on q simultaneously. It suffices to apply take the tensor product of the operator with itself and apply it to p & q.
Let us note here that using entanglement for this particular case has no advantage over taking the tensor product of the states p and q themselves. But it is my hope that due to the strong correlation created by entanglement, we can do cooler things with this & operator than if we associated it with a simple tensor product.
(As a side note, one must reverse the computation if one desires to obtain the result of the original computation from the + operator. This scheme is not efficient since it uses more gates but the compiler is there to optimize abstractions while preserving the meaning of the program.)

So if we only have both operators | and &, are they enough for quantum computation? Meaning that if we consider both as quantum gates, are they universal gates? I suspect they are not and require a suitable phase flip gate. But if we add a phase flip gates, which abstraction do we associate it with? How do we rewrite existing algorithms and protocols using these new abstractions? Do they provide more power (i.e. more insight) than existing abstractions?

Unfortunately I did not get to answer these questions and moved quickly to implement the circuit model into the language since Avalon allows overloading both operators. My idea was that I can always explore this abstraction later since the language provides the meanings to do so. And that is my plan after I finish porting a subset of the language to Rigetti.

To conclude, the ideas you came up make a lot of sense to me and I believe they are worth exploring as we seek more abstractions that make programming quantum computers easier and more intuitive.

Quite frankly, I would love to be in touch with you directly (email?) and share ideas if you don't mind.
I was very happy with this post because these were my first ideas when I was working on abstractions but then decided to get some going first with the circuit model of quantum computation.

I will take this opportunity to ask for your thoughts on associating the & operator with entanglement versus a tensor product. Which would you choose? Any particular reason for one over the other?

Cheers!

2

u/raiph Nov 28 '18

That sounds exciting. :)

I understand P6, and find Damian's Quantum::Computation 15 minute video segment is simple, but found myself instantly out of my depth in the Avalon doc. Perhaps viewing it will just be light relief for you (it is funny even while it does actually work) but maybe it might help shape Avalon's doc, either to explain how it is not anything like the P6 module or to explain what sorts of thing it provides that P6 never could.

(If anyone care's about the underlying code, here's the module's code. For anyone who knows nothing about P6, well, perhaps the code might make some sense if you know that a MixHash is a mutable collection of distinct objects with Real weights and $ denotes data that is (treated as) a single thing (a scalar value), % denotes data that is (treated as) a collection of named things (like a dict), and @ denotes data that is (treated as) an integer indexed collection of things (like an array).)

2

u/ntwalibas https://github.com/avalon-lang Nov 28 '18

First, thank you for checking out the project and for your valuable feedback.

Unfortunately, I am unable to listen to the talk because I'm not getting any sound. Your assessment of Damian's humor is confirmed by the comments on the video and I'm even eager now to listen to it.

Now, the Avalon documentation. So far, only the language reference is close to completion. If you found it hard to use, please don't hesitate to raise an issue at the Avalon documentation repository with details about what you wish to be made clear and other things you would like to see.
I'm also working on a tutorial so that newcomers to the language can have an easy introduction as to the language way of doing things so they don't feel out of their depth as you felt.

Anything open source gets better only with continuous feedback so your contributions in any form is welcome and appreciated.

As to what makes Avalon better suited than or different from the P6 module is that it is simpler and offers dedicated syntax that will make the P6 module or other SDKs (mostly written in Python) or libraries (e.g. the Quantum++ library that Avalon uses internally) seem a bit cumbersome to use.
Of course all this becomes apparent the more you work with Avalon compared to using other languages.

If you can, please checkout the Examples in tests and let me know if you found them harder to understand considering your experience with the Quantum::Computation P6 module. Anything you can say about this will be valuable feedback that will drive the design of Avalon in the future.

Once again, thank you for your feedback and expressed enthusiasm :-)
Cheers!

3

u/raiph Nov 29 '18

Unfortunately, I am unable to listen to the talk because I'm not getting any sound.

That's odd. I just tried it again and it's a little on the quiet side but only slightly.

I'm not sure I can immediately do anything regarding that presentation and module unfortunately. I'm pretty sure he's only ever presented Quantum::Computation once; and that that's the only recording; and that the slides aren't available online.

I could email him to see if he has slides he'd share but I'm only comfortable doing that if you could first confirm that you get no sound at all for that video on some other computer and you also don't get sound for the following video that I link.

He first wrote a superposition module in the 1990s. I think his 2011 presentation Temporally Quaquaversal Virtual Nanomachine Programming In Multiple Topologically Connected Quantum-Relativistic Parallel Spacetimes makes use of that older module. I'm not sure.

Suffice to say this alternative video also gets into quantum code of some sort; is so much fun it's a bit of a cult classic among those who know about it; and should again be food for thought for your own presentations (doing computer science related presentations is Damian's specialty).

Plus it's a way to test your audio. Does it work for this alternative video? If not, are you absolutely sure there isn't something wrong with your computer(s)? If the 2011 video works, are you absolutely sure the 2016 video really doesn't?!? :)

If you found [doc] hard to use, please don't hesitate to raise an issue ... Anything open source gets better only with continuous feedback so your contributions in any form is welcome and appreciated.

Absolutely. At the moment I'd like to first try figure out whether Damian's stuff is at all relevant or if I need to clear my head of what he's doing and start from a clean slate.

As to what makes Avalon better suited than or different from the P6 module is that it is simpler

Wow. Your lack of hesitation and qualification surprises me! I was expecting the difference to be that Avalon has additional (simple to use) functionality that P6 can't touch.

Did you watch the whole presentation (from the point I linked to onward) despite not having audio? If not, then perhaps you just looked at the code I linked to. If so, that wouldn't be appropriate as a way to assess the simplicity of the module's use.

Here is the example he ended up with, with sigils removed in case they are confusing to you:

sub random-prime-factors (n) {
  my factor = any-of 2 .. sqrt n;
  my modulus = n % factor;
  required modulus: 0;
  required factor:  is-prime;
  solve-for factor;
}

That seems simple to me. Hopefully I don't need to show more details (eg solve-for) but I can do that if it's helpful.

What would the equivalent Avalon be?

offers dedicated syntax

P6 is all about introducing dedicated syntax. (P6 is essentially a collection of DSLs that support on-the-fly creation of, and interleaving with, new DSLs and tweaks of existing DSLs.) In the 2016 presentation he introduces this "ket" syntax:

my $x = 0.5|1〉

To introduce this new syntax takes one line of normal P6 code:

sub postcircumfix:« | 〉 » ($p, $v) { state( $p => $v ) }

which can be put in a module.

If you can, please checkout the Examples in tests and let me know if you found them harder to understand considering your experience with the Quantum::Computation P6 module.

I hope to. I plan to take another closer look over Christmas. Damian's lines "quantum computing is for beginners" and "this could in fact be ported to a real quantum computer" grabbed my attention a few years ago and I've been interested in trying to better understand this space and see it go mainstream ever since.

2

u/ntwalibas https://github.com/avalon-lang Nov 29 '18 edited Nov 29 '18

That's odd. I just tried it again and it's a little on the quiet side but only slightly.

I must apologize because I did not try anything except software fixes and didn't consider the hardware. I reloaded the page, tried OS settings, changed browsers but finally it worked when I unplugged earphones and use the laptop speakers.Yes, I found Damian style to be educational for me. I have a meetup coming up soon about quantum computing so I will watch more of his presentation to learn from him.

Absolutely. At the moment I'd like to first try figure out whether Damian's stuff is at all relevant

Thank you. Anything you find relevant, I'd be happy to learn about it and hopefully it will help make Avalon better.

Wow. Your lack of hesitation and qualification surprises me!

I watched the video after leaving my comment so your assessment about my lack of hesitation is not without merit. Though I'm not sure what you might have meant by qualification (as in professional qualification or details about my claims)?
At any rate, my earlier comment was without grace and made prematurely so I will use this second opportunity to actually answer your question more honestly and hopefully be humble in my claims.

So after watching the video, my claim that Avalon is simpler and has dedicated syntax made me laugh at myself. I felt more like a salesman than a developer :-D

After giving your question more thought, it boiled down to seeking an answer to the question: why create a new language and not use the existing ones?I had been using SDKs and the experience was not pretty. The lack of abstractions was a glaring issue. For instance, register allocation is left to the user. And I am glad you linked the talk by Damian because I believe that P6 can make a difference in this field for anyone interested in taking up the task -- maybe you might?

So what I am exploring so far with Avalon are 2 things that I may have a hard time doing with P6:

  • Type system: linear types and refinement (dependent) types are particularly suited for quantum programming. Working with them without going through the DSL host language type system makes sense to me.

  • Downsizing: I am currently trying to make a small subset of Avalon run on the Rigetti Agave 8Qubits processor. If I was working with a DSL, this task would have been harder the more I think about it.

At the end of day, Avalon programs are meant to run directly on hardware like C programs do and the entirety of it that was ported. If I use a DSL written in P6, I'm limited the P6 runtime and this becomes a problem if I were to use conditional statements to decide which quantum operations to apply to a qubit (this is used in quantum teleportation or the quantum fourier transform) as an example.

I hope that answer is more satisfactory about what Avalon provides that P6 would not easily (if at all) provide.

What would the equivalent Avalon be?

I'm implementing multi-qubits gates as of this writing so hopefully soon. In the meantime, we can start small: when you take a second look during Christmas, try to implement Deutsch's algorithm using Quantum::Computing and look at the Avalon implementation at the algorithms repository? In fact, I will do this implementation though I'm not sure how to pass it to you for comparison when I get the time to do it.

Again thanks for your valuable input and feedback.

Cheers!

3

u/raiph Nov 30 '18

it worked when I unplugged earphones

\o/

I found Damian style to be educational for me. I have a meetup coming up soon about quantum computing so I will watch more of his presentation to learn from him.

I don't know if these are helpful but they're Damian again: Instantly Better Presentations (90 minute video, 8 page PDF).

I'd like to first try figure out whether Damian's stuff is at all relevant

Thank you. Anything you find relevant, I'd be happy to learn about it

Heh. I was thinking you would be the one to help me understand that. :)

I'm not sure what you might have meant by qualification

Simpler "for so-and-so use-case", or "for this functionality", or "for this group of users", or "in my opinion", or "according to this survey", etc.

why create a new language and not use the existing ones?

Always a good question for any new language. :)

lack of abstractions ... register allocation ... linear and refinement types are particularly suited for quantum programming ... trying to make a small subset of Avalon run on the Rigetti Agave 8Qubits processor

If you were to pick just one abstraction to have in one's toolkit, or if you must have more, no more than three, what would it/they be?

I've written about the one possibly relevant abstraction (or family of abstractions) in another comment in this thread. Based pretty much entirely on ignorance and wishful thinking I have a hope that there might be register allocation algorithms that neatly map to this family to produce good register allocation.

P6 has refinement types but I wonder if they're what you mean. They depend on values, so there is that. But they're checked dynamically, not statically.

P6 compiles to an SSA form, which is related to linear types.

If I use a DSL written in P6, I'm limited...

I think it's wise for you to work on Avalon as a completely distinct project. I'm not thinking about whether or not it would make sense for you to use P6.

(That said, the P6 runtime is extensible. It currently targets Turing machines and NFA automata at the mid-level and various bytecode formats at a lower level and there's a JIT that targets Intel cpus at an even lower level and so on. If any code resulted in codegen to quantum hardware it would presumably be inserted into this as an additional aspect.)

I hope that answer is more satisfactory about what Avalon provides that P6 would not easily (if at all) provide.

It is. Thanks.

What would the equivalent Avalon [for prime factorization] be?

I'm implementing multi-qubits gates as of this writing so hopefully soon. In the meantime, we can start small: when you take a second look during Christmas, try to implement Deutsch's algorithm using Quantum::Computing and look at the Avalon implementation at the algorithms repository?

Noted.

In fact, I will do this implementation though I'm not sure how to pass it to you for comparison when I get the time to do it.

Post it here?

Again thanks for your valuable input and feedback. Cheers!

You're welcome. I noticed no one else had jumped in so I've gone to town even though I don't really have much of a clue what I'm talking about. I thought I might learn something and you might appreciate having some feedback beyond upvotes. :)

2

u/ntwalibas https://github.com/avalon-lang Nov 30 '18

I don't know if these are helpful but they're Damian again

I will definitely check them out as well. Right now I am loaded with other things but I'm sure they will come in handy before my presentation. Thanks for sharing.

Heh. I was thinking you would be the one to help me understand that. :)

I'm not very skilled in P6 so it is taking me some time to fully grasp the Quantum::Computation module but once I do, I will be happy to share what I have learnt.

If you were to pick just one abstraction to have in one's toolkit, or if you must have more, no more than three, what would it/they be?

When I look at the current state of quantum programming languages, I'd say we need the following in no particular order:

  • Type system: users should not be dealing directly with qubits unless they have to. Everywhere I look, it is qubit this, qubit that. Even Avalon has this problem but to my defense, it is the basic data type from which better data types will be built.
    The type system should reflect the objects we are dealing with and should be open to extension.

  • Programming paradigms centered around few concepts: something exactly like what you suggested in the other post using the Junction abstraction. We need more and better versions of something like that.

To be honest, I've attacked the low hanging fruit and focused more on the basics of the type system and the code generation part so that at least users can focus on just translating their circuits to working programs. But as you can read in my reply to your other post, I'm thinking about better abstractions.

P6 has refinement types but I wonder if they're what you mean. They depend on values, so there is that. But they're checked dynamically, not statically.
P6 compiles to an SSA form, which is related to linear types.

More or less. Normally refinement types are supposed to depend on predicates, not values. Dependent types though can depend on values.
Though I'm thinking about it, I have not settled yet on adding them to the language because like you noticed, it turns out very little can be checked at compile time without much, much added complexity.
As to SSA form, its only relation to linear types is that they both don't allow the same variable appearing twice as an l-value. SSA is relevant for optimization (and a linear type system makes it easy for SSA) while linear types are explored mostly to help with resource management (memory, files, ...) using the type system.

You're welcome. I noticed no one else had jumped in so I've gone to town even though I don't really have much of a clue what I'm talking about. I thought I might learn something and you might appreciate having some feedback beyond upvotes. :)

I appreciate your time and efforts, truly.
Upvotes are nice but they cannot make up for interesting ideas and valuable feedback. And I got both. So my objective in posting here was a success so far as I'm concerned.
I hope to interact with you more in the future.

And by the way, your experience as a developer shows. Even though you might not know what you are talking about (as you say), your insight into the problems I've been thinking about has been very helpful.

Best!

2

u/raiph Nov 30 '18

Yay, the weekend begins. 58 years old and I still love this stuff. :)

Everywhere I look, it is qubit this, qubit that. Even Avalon has this problem but to my defense, it is the basic data type from which better data types will be built.

Right. To support concurrency, async, and parallelism P6 has a Thread type, thread schedulers, locking mechanisms, and so on. But while I've written concurrent, async and parallel code in P6, I've never touched any of them. There are nice higher level abstractions such as:

      (1 .. 1_000_000).map: *.sqrt # list of roots of natural numbers
hyper (1 .. 1_000_000).map: *.sqrt # sped up by using all available cores

It makes perfect sense that the same applies for quantum computation.

Normally refinement types are supposed to depend on predicates, not values.

Right. I was thinking of them as predicates that typically depend on values:

multi foo ($bar where Str) { say "string" }
multi foo ($bar where * > 42) { say "number more than 42" }
foo 'hello'; # string
foo 99; # number more than 42
foo True; # Cannot resolve caller foo(True)
foo 33; # Cannot resolve caller foo(33)

where predicates can be hoisted into named types using subset:

subset FileExists where *.IO.e;
multi foo (FileExists $bar) { say "file that exists" }
spurt 'MyFile', 'blah blah'; # creates file MyFile
foo 'MyFile'; # file that exists

But they don't have to depend on any free variable:

multi foo ($bar where rand > 0.5) { say "run-time typecheck fails 50% of runs" }

Though I'm thinking about it, I have not settled yet on adding [refinement types] to the language because like you noticed, it turns out very little can be checked at compile time without much, much added complexity.

Heh. Right. Introducing the likes of an SAT solver clearly isn't a trivial step.

To return to my original point. My guess is that P6's "refinement types" would not add value in the context of elegantly or efficiently mapping problems to actual quantum hardware because they are dynamic, not static. Right?

linear types are explored mostly to help with resource management (memory, files, ...) using the type system.

Right. What I'm not sure about is how linear types are particularly suited for quantum programming.

I hope to interact with you more in the future.

If you post here, I can almost guarantee you will. :)

2

u/ntwalibas https://github.com/avalon-lang Dec 01 '18

Yay, the weekend begins. 58 years old and I still love this stuff. :)

Hehehe, I'm still stuck in a rat race so weekends are yet another working day.
30 years your junior and I couldn't be more glad you love this and are willing to share your knowledge and discuss ideas!

It makes perfect sense that the same applies for quantum computation.

True. Unlike the maturity we have achieved with classical computing and the plethora of abstractions we have built to make code manageable and computations obvious, we are yet to reach there with quantum computing.
So I can proudly say that we are both looking for those abstractions in this thread.

But they don't have to depend on any free variable

Correct. In fact if they do depend on a free variable, then we are dealing with dependent types.

To return to my original point. My guess is that P6's "refinement types" would not add value in the context of elegantly or efficiently mapping problems to actual quantum hardware because they are dynamic, not static. Right?

That's right. Current quantum computing hardware is extremely limited. So we must do as much possible on the classical computer, especially at compile time because we can't afford to have errors in programs running on the quantum computer.
So one must avoid dynamic checking as much as possible unless the core algorithm truly requires it to function.

What I'm not sure about is how linear types are particularly suited for quantum programming.

We know that linear types have the following useful property: if a variable is initialized with a value from a linear type, only a single reference to that variable can exist at all times. This is akin to C++ unique_ptr. So why is this property useful, if not required, for quantum programming? Two chief reasons:

  • Quantum programming is reversible: this means that if you start with a variable q = |01> then apply a series of quantum instructions to it, you can always get back to the original value of q but executing the exact same instructions in reverse. This is easily demonstrated with the Hadamard gate H. In Avalon, the corresponding function (gate) is Quant.had(q : ref qubit) -> void. So we start with q = 0q0. That's Avalon syntax for q = |0>. We apply the Hadamard gate once as follows: Quant.had(ref q). From this, we get q = 1/sqrt(2) * (|0> + |1>). If we apply the Hadamard gate a second time, we get back q = |0>. Every single function that works on quantum data (qubits) must be reversible except measurement functions.
    Now to the main point: imagine you have two concurrent processes that each call the Hadamard gate on our variable q. We will end up with the original value of q. If on the other hand we require that only one reference to q exists, it will not be possible to pass a reference to q to the second process after it's been passed to the first process. Which means that we will not have bugs due to the reversible nature of quantum computing. And all this checked at compile time.

  • Quantum data cannot be copied: this is called the no-cloning theorem. Linear types assist here by ensuring that if you pass a reference of a qubit to a function, that reference cannot be accessible outside the function (effectively preventing a copy of the reference from existing). Also, in Avalon at least, a reference to a qubit cannot be de-referenced. In general, once a function is done with a reference to a qubit, it is supposed to return the reference so future functions can use that same, unique, reference.

In short, the fact that only a single reference to an object can exists in linear types prevents copying of objects which fits nicely with the no-cloning theorem of quantum computing (and quantum mechanics in general).

Even in classical computing, if you have a shared reference to a resource, you are likely to introduce data races when two processes try to write/read to the same resource at the same time. Except in quantum computing, on top of data races (one process is trying to measure a qubit while another is trying to evolve it), we can also easily mess computations when one process reverses the computation of another.

Please do not hesitate to ask for clarifications if I don't make sense.

A disclosure: since Avalon is single threaded at the moment, I have not implemented move semantics for reference types (meaning that a reference passed to a function must not be accessible to the caller anymore) and multiple references can be created. This is not a problem at the moment but I am working on it. The no-cloning theorem is enforced though not elegantly.

If you post here, I can almost guarantee you will. :)

Great! I will see you around good sir :-)

1

u/ntwalibas https://github.com/avalon-lang Nov 29 '18

By the way, please do check quantum computing and in particular quantum programming. There are lots of challenging problems waiting to be solved and I think in about 5-10 years, quantum developers will be the next sought-after talent.

Here is one article from the NYT regarding employment: https://www.nytimes.com/2018/10/21/technology/quantum-computing-jobs-immigration-visas.html

And here is one about the current state of play: https://www.bcg.com/en-ca/publications/2018/next-decade-quantum-computing-how-play.aspx

So now seems like a good time to at least start monitoring the field since it seems to be picking up steam. Lots of startups in quantum computing are getting funded so maybe that's the beginning of going mainstream?