So yeah, I thought it was going to be very short presentation to actually present the language,
which is called H hat and breaks the rule that Nate said about having Q on everything
in quantum related, yeah, that's the idea.
So I thought, yeah, maybe talking about something that is very different from everything else,
which is the quantum type system that I've been developing on it, and yeah, maybe having
some more discussions later on.
So just a quick summary, just briefly talking about H hat and then quantum systems and Q
on it.
Yeah, H hat for those who are physicists, H hat is kind of a big name or big expression in physics,
and yeah, it seems they write an N2 to give it.
So basically it's a high level abstraction quantum programming language, and that means that
you have the user facing layer on the quantum stack right below the user, and the idea
is basically to be data for your internet, and it means that you don't have to think about
physics, which is strange at first, but today it's to evolve to something else and actually
think more in terms of what we already know about programming, and that's in the end.
The ones that are going to build software will be the software engineers, so it makes sense
to actually make things more structuring the way that we are also to do.
So yeah, first defining quantum data, so everything that has a hat in front of it is quantum,
I think all of that, so you kind of can differentiate between literals and quantum, of
course you have to encode and so on and so forth, but that's the next step that basically
you need to define and compose the data structure, and then the quantum data types, such
as quantum Boolean, quantum integer, so on and so forth, and of course you can have user
defined types with structs or in norms, etc. For instance, you can have some like a source
and target of Boolean, so they are basically part of a single data type, or something more
structuring or more complex, you can do as you wish, and yeah, that's basically it.
So the first step is similarly to what we have on classical computing, you basically need
to define some limits from what you can actually have in terms of quantum resources, so instead
of thinking of registers or bits, we need to think of in terms of qubits, in the language
I call it indexes, because they don't want to make people, they are not used to quantum
to start having to think about quantum, so I try to strip off all these physical concepts
and try to make them more computer science related, so it's simple, if you have a quantum
integer of size 2, so you have two qubits in the end to work with, you have more, you have
more, if you have less, so they do suit computers and try to reach the point where you cannot
go further, because the quantum computer does not have more memory or resources to do the
computation, and then it can be calculated during the type checking basically, if it's
possible, but usually it is, and of course you have to define quantum variables, and they
are kind of different from the usual variables, because they do not execute or do anything
at first, they just are pending instructions, because we need to remember that quantum
computers, they are very slow in the sense of during computation, compilation and computation
going back to the CPU, so we need to get as much resources or as much algorithm in one batch
and execute it at once, so a variable is just accumulating all these instructions, and
for instance you have a variable queue of type quantum Boolean, and it will have a function being applied
to this literal quantum false, this is basically translated as having these instructions
inside of its data, so in the end it will be converted to something useful that we are going
to talk about right now, because once you have this quantum variable or quantum anything,
it's quantum, so you cannot print it, you cannot do anything other than accumulating things
inside this quantum variable, but what you can do is basically, I want to cast this quantum
variable into something that is classical, in that sense, I'm just saying, yeah, I want to cast
this operation into unsignet 32 integer, and from this part on, basically what happens is we are
going to have some steps to be accomplished, the first one is to actually compile those instructions
inside the quantum variable into something that the quantum language can actually understand,
in this case I took an example of Kiske, it's open quantum, so basically that instruction
within a three at YouTube, it's basically this simple instruction in open quantum,
after that, you basically execute this into a emulator, or keep you, and you may have these
sites of resulting data, it can already be strings and probability are counting of values,
and in that we have to work with these results, but remember that we want to have a unsignet
integer of 32 bits, so we need to convert somehow this into this U32, and the way that we do this
is basically we can define right now it's kind of implicit, but we can define like the way that
we actually want to represent this result, so yeah we can have this as a raw result, or we can
have a weighted average, or the highest value, or the lowest value, we can kind of define how we
want to interpret this, and depending which kind of the resolvers protocol we choose,
we have different outcomes, and after that we basically guess this resulting to the actual type
that we want to convert to, so in this case of the raw we cannot convert, because it's a dictionary,
so it's not compatible, but in the other cases we can actually have something that is kind of
convertible, yeah, there are some other points that I would like to discuss, but maybe we can
do on the Q&A session, which is the index manager, basically how you can actually manage the
qubits throughout your program, for instance, how you actually have this quantum functions converted
into quantum instructions, and for instance how you define the quantum instructions order,
it's important when you consider that you may have in case of the last talk, we may have distributed
systems like quantum networks, so you may want to ask some other computer to execute some
command at some specific time, so you actually need to have like this track of which instruction
should be performing the first or later, and yeah, there are many other points, but basically the
idea is there, and yeah, which me out if you want to know more about the project, I deliberately decided
to choose a fast talk, so you open for questions, maybe you have a lot of questions,
if you want to know more about the project, I should push the last changes that we will make
actually this example of feasible in a few days, I was finishing it, but a little buggy,
but yeah, you can check that out there, yeah, let's see
you have the compiler of the language, or I don't have the definition, well
right now let's say that because we have many dependencies on the current stacks,
SDKs and quantum in most of them rely on Python, I decided to start having this interpreter in
Python, also because it's easy for people to see the code and collaborate or discuss, but I also
have another branch that has rust code on it, and there it is basically to have like the documentation
of how the language should behave, and Python and rust being compatible for benchmarking,
and in the future having like a full probability, uh, language, because quantum, yeah, you cannot
like compile basically everything, you have to actually execute most of the things that are
inside this quantum variables in time, yeah, and one of the points that I still want to address
is basically like you don't have to freeze all your classical programming side while the
quantum is working, the same way that GPUs does not freeze like your CPU, so yeah, you can think
of keep you being basically another driver that you can send very specific instructions, and then
somehow or sometimes they will come or not, so they are just waiting for being synced again,
and one just to complete one of the ideas that I had is basically to try to use the
rationale behind airline to the language, because I think the best distributed programming language
out there is a relank, because yeah, you can make things break and they still work nicely,
are gracefully the stop working, but yeah, it's kind of a interesting point.
Another one that I had a lot of time trying to figure out is you can have two quantum variables,
and then you say, yeah, I went to entangle them, but then I do something else with one of them,
and it interacts with other parts of the code, how I can ensure that things are connected,
because remember I am just saying that this quantum variable is a holder for all the instructions,
so now you are in this cascade of dependencies from different variables, and you may not know
like which ones you need to execute first or later, so that's why I think having these quantum
types are very useful because you can basically say, yeah, everything inside this quantum variable
that belongs to this quantum type will be executed just once, like just at that time,
so you can basically protect from like undesired or side effects, again.
Yeah, yeah, yeah, sure.
Yeah, actually it's much more simple, it's far not too overflow,
oh yeah, to talk a more about the index manager in the language, it's very simple, actually,
because like in computers you have the alignment of your type, right, or it's throat, or you know,
but in quantum, since you barely have like resources, you shouldn't like align
everything with one size only, right, so if I'm working with quantum YouTube, yeah, just too
cube, it's very simple, very dumb, but you can do some working examples, and you have another
like type that actually uses, yeah, for instance, this quantum-type will probably is bigger than
just one cube, so I need to account for this one cube, plus this, whatever more cube it's it has,
so it has to recursively look for like how many cubes it needs to allocate in one execution,
so it can decide whether it's a valid execution or not, because let's say your quantum computer
has 20 cubes, and it requires 30, so it should not execute, that's the idea, and this part of
quantum, it's basically how you define this type separated, we can discuss later if you want,
but yeah, it's interesting topic, yes, so I'm going to say directly if you want to
make a cast with a function, let's say then I cannot make two quantum variables and take them with
other objects together, because that would there would be the problem that half of the measurement,
the other stages is for it, and that you, that just over that way, that you have all
circuit in one type, right? Yeah, the question is basically there is this problem with entangling
two quantum variables for instance, and then you measure one and then the other is kind of loose,
and trying to solve that you basically have these like quantum data types, yeah that's true,
and you can think as a functional programming paradigm basically, because now we are like in this whole
box, everything just happens inside, there's no like outside side effects, at least on quantum,
so it's basically contained, I mean it can be remotely, like you can do a teleportation,
but it's still it's contained in this quantum data type, so it solves a lot of problems,
because let's say that in the middle of the computation you need a previous value that you actually
measured, or cast into the next quantum computation, so if they are separated quantum variables,
you kind of have to cast both, but not really just have, so how do you decide that or what you should do?
I think it's quite confusing what this is, but it's very difficult for a software here.
Yeah, and I didn't cover anything like, because I'm kind of destroying physics here,
there's no concept of cubits, there's no measurement, there's no superposition,
angle measurement, everything is kind of to sound like computer science and data being transformed,
basically, like this, yeah, this reading, it's basically a hardware, but I'm basically
like, um, redimensionalizing it to have space for a more things, but that's the way that I
could find, it's not talk about physics, talking about physics under the hood.
Yeah, in this case, I didn't explicitly show anything, but in this case, it's just,
the highest value, but after the cast, you should have like this pointy squares and say,
like the kind of protocol you want to use to actually convert the data.
Yeah, it's a dictionary, right? I mean, it's like adding string with
integer in Python, it doesn't work. Yeah, I mean, if you have a hash map or a dictionary type,
you can actually have your role value. Yeah, thanks.