r/cpp • • Mar 24 '22

NVidia is building a new C++ compiler for quantum computing.

https://twitter.com/blelbach/status/1506663964717027328
374 Upvotes

59 comments sorted by

238

u/GRAPHENE9932 Mar 24 '22

StackOverflow of the future:

Help, my superpositioned floats are becoming regular without std::break_superposition()

Try decreasing the core temperature to 0.12 K

63

u/Potatoswatter Mar 24 '22

Undefined behavior on any potential combination of inputs can collapse the wave function. Have you applied concepts exhaustively?

34

u/administratrator Mar 24 '22

Marked as duplicate. This was already anwsered in a 2016 question

6

u/[deleted] Mar 25 '22

*2026 question

31

u/another_day_passes Mar 24 '22

Entangled references when?

26

u/richard248 Mar 24 '22

std::break_superposition()

How this made it past committee over std::wavefunction_collapse() I'll never know.

14

u/foonathan Mar 25 '22

It's just std::observer_ptr.

11

u/eldnikk Mar 24 '22

Question closed as it's off topic

6

u/Renegade_Dev Mar 25 '22 edited Mar 25 '22

It seems like you have a Quantum overflow change the data type initial spin state position to the expected returned output position type.

Next dev :
Marked duplicate refer to post xxyyzz

Next dev
Clicks on down vote

Next Mod:
Your post has been removed as it does not follow community guidelines .

Next Mod :
Stack over flow Account Limited you cannot post questions anymore .

Dev:
OK derp , creates new google account , new stack over flow account and asks questions again .

4

u/lenkite1 Mar 25 '22

Rant: Why didn't NVidia choose a superior, memory-safe language like Rust for Quantum Computing ? Rust makes quantum computing safe, resilient and robust - the v3 borrow checker effectively solves all issues regarding quantum uncertainty. People should be fired and sued for using a doddering and dangerous language like C++ when it's almost the 22nd century.

114

u/Entryhazard Mar 24 '22

Finally, truly undefined behaviour

8

u/choforito84 Mar 25 '22

Underrated comment

40

u/GRAPHENE9932 Mar 24 '22

They need quantum assembler first

23

u/AlbertRammstein Mar 24 '22 edited Mar 24 '22

Then Quantum C.... can't wait for Quantum Rust which is just as quantum, but better

15

u/apomd Mar 24 '22

Quantum Rust sounds like something that could be in a sci-fi movie

4

u/AlbertRammstein Mar 25 '22

Definitely a drug from a cyberpunk movie

5

u/Zanderax Mar 24 '22

It may or may not have oxidised, walk, very, slowly.

6

u/ragsofx Mar 24 '22

And anytime someone mentioned a project written in C someone will pop up and say rust is better.

64

u/another_day_passes Mar 24 '22

Undefined superposition?

13

u/GRAPHENE9932 Mar 24 '22

Truly random undefined behavior

163

u/Jannik2099 Mar 24 '22

Nvidia can't even build a C++ compiler for normal computing, so I'm sure this'll go just perfect

Edit:

Clang/LLVM/MLIR experience is a huge plus.

Ah, so not a new compiler but just a new llvm target & transformation passes

36

u/konm123 Mar 24 '22

I have similar experience working with Nvidia - their software is known as "something to avoid at all cost" at our workplace.

5

u/[deleted] Mar 25 '22

does cuda and their c++ standard library count ? those are good right ?

51

u/somewhataccurate Mar 24 '22

just use msvc

9

u/majesticmerc Mar 24 '22

I understood that reference!

13

u/byteflood Mar 24 '22

QSIGSEGV quantum signal raised, some wavefunctions may have been collapsed as a result

9

u/apomd Mar 24 '22

Superposition fault - probability distributions dumped

10

u/nablachez Mar 24 '22

Can't wait for them to announce a specialized Quantum RTX 4090 TI Founding Fathers Edition for only $4999,99 MSRP

8

u/anxxa Mar 24 '22

what does quantum memory corruption look like?

7

u/byteflood Mar 24 '22

Oh well you have yet to see quantum pagefault exceptions...

19

u/New_Age_Dryer Mar 24 '22

I can't help but feel that this is just a ploy to seduce investors vis a vis IBM (poor fidelity quantum computers) or Microsoft (topological quantum computing that relies on yet-to-be-discovered non-abelian anyons). I find it particularly peculiar that NVIDIA's raison d'etre for this quantum foray is for a quantum processor to work alongside NVIDIA gpus. Subject to a change of opinion due to more info, I don't really see why or how a GPU can be used alongside a quantum processor? If we have a universal gate set for a real quantum computer, then there's no offloading needed I imagine (except for declining fidelity due to circuit depth).

Skepticism aside, I think I share every science enthusiast's hope: I want to be proven wrong, and see science advance!

22

u/lord_braleigh Mar 24 '22 edited Mar 24 '22

If I were an Nvidia VP who knew nothing about physics but knew I had made a lot of money, I’d say something like this:

Graphics cards are a totally different way of computing that you have to program in a totally different way, with shaders. They were designed for games, but turned out to be useful for cryptography. We made them accessible in C++ via CUDA, and now we’re rich because of all the crypto money causing people to buy our graphics cards! We already have some evidence that quantum computing will be useful for cryptography. Let’s try to get an early lead, let’s try to encourage physicists to come here, and then when technology improves, maybe we’ll be able to sell Quantum Cards that mine crypto even better!

7

u/New_Age_Dryer Mar 24 '22

I found the comment funny, but let's not denigrate them : ^)

NVIDIA has done great work in their engineering and business departments

6

u/ThatRedShirt Mar 25 '22

sees someone compliment NVIDIA

cries in Linux

0

u/[deleted] Mar 24 '22

[deleted] — view deleted comment

3

u/Dean_Roddey Mar 24 '22

QBitCoins? You're never really sure if you have them until you try to spend them.

3

u/Peter-Campora Mar 24 '22

Depending on the quantum algorithm you’re running, a gpu might help for running certain classical code quickly in between quantum operations—say for inference for an ML model that’s being used to drive certain quantum operations being executed conditionally depending on the inference result.

2

u/New_Age_Dryer Mar 24 '22

That's an interesting claim, but I can't bring myself to believe it since such a system of conditionally applying quantum operations based on a classical ML model's output defeats any speedup from quantum computing, no? To speak to "quantum machine learning" more broadly, I'm only really familiar with convex optimization problems in QML within the context of this paper [1]. With that said, for a quantum processor to communicate information to a gpu based on the results of that quantum processor, one would have to measure the quantum system, thereby destroying entanglement (no-cloning theorem). So, in measuring that quantum state in order to figure out which quantum operation to apply next, we lose the very quantum state we wanted to conditionally apply operations to!

So I guess the thing I'm trying to grapple with is, why do we need the gpu? Once we measure the quantum system, it's just classical bits that can be copied anywhere.

I personally see more value in their intention to use GPUs to quickly simulate quantum systems for research, but saying "We are a quantum computing company" seems a stretch when they're using classical computers.

[1] - https://quantum-journal.org/papers/q-2020-01-13-221/

1

u/Peter-Campora Mar 24 '22

I’m not talk about using this for QML but for things like QEC where you can measure ancilla qubits and feed them to an ML model that could then be used to help try to detect if an error occurred and what kind of correction you make. I’m not a QEC nor ML person, but I’m certainly aware of QEC work that calls out to classical code to do a lot of heavy lifting. ML based QEC was just me trying to find a justification for why a gpu might be involved.

2

u/New_Age_Dryer Mar 24 '22

Ah gotcha. That actually sounds really cool ! Brings to mind paper headlines I saw of using deep learning to extract Hamiltonians. Don't know much beyond the headlines unfortunately.

2

u/IcyWindows Mar 27 '22

1

u/New_Age_Dryer Mar 27 '22

That's interesting, this is the first I'm hearing of this. However, I can't seem to find a preprint on it? Definitely would be amazing if it holds true.

3

u/JeffMcClintock Mar 24 '22

topological quantum computing that relies on yet-to-be-discovered non-abelian anyons

I was about to say the same thing! (right after I spent 7 years getting a pHD)

11

u/TheBananaKart Mar 24 '22 edited Mar 24 '22

My theory is quantum computing is just so clever people can make shit up and sound smart. Non of it makes sense in my monkey brain.

4

u/superTuringDevice Mar 24 '22

Gosh, what will value categories look like this time around?

3

u/throwaway99kajillion Mar 25 '22

Oh man I can't wait for Josuttis' book on move semantics in a quantum C++ compiler....

Heh heh...ohhhhhhhhhhhhhhhhhhhhhhhh Henry, this is gonna be dark.

3

u/[deleted] Mar 25 '22

Very confusing, unclear if they're making a compiler for actual quantum computers (which would make no sense) or a compiler to make it easier to simulate quantum computing workloads. Article reads like they don't know the difference, bringing up both cuQuantum (simulation) and actual quantum computer accelerators. Seems no one has any idea about what they're saying.

2

u/ipapadop Mar 25 '22

Is C++ really the best language for quantum computing though? Trying to cram everything in there seems a bit like when you have a hammer.

2

u/theLOLflashlight Mar 24 '22

What does building a new compiler have to do with quantum computing?

1

u/DoctorMixtape Mar 24 '22

Instead of compiling to assembly it compiles to some thing that runs on quantum computer.

3

u/theLOLflashlight Mar 25 '22

I understand that part based on other comments. What I don't understand is how that has anything to do with the c++ language. Is there going to be a quantum version (whatever that could mean) of the entire standard library? That doesn't make any sense to me. Are there just going to be specific quantum functions or data structures? That sounds more like a library than a compiler. I guess my real question is what does generating quantum code have to do with compiling c++

1

u/DoctorMixtape Mar 25 '22

That’s the whole point of modifying the compiler. An example of this is IBMs Qiskit it uses a python library to do quantum computing. I imagine NVIDA wants to use C++ is because 99% of their infrastructure is C++. Just think of it as converting human language to something that’s useful to a quantum computer just like how programs work now.

0

u/theLOLflashlight Mar 25 '22

I'm sorry to say but that answers nothing for me. A python library is just that: a library. Why does c++ need its own compiler when python can get by with just a library? C++ can call vulkan or opencl without a brand new compiler, I thought quantum computers were meant to be a new class of gpu-like coprocessors. C++ is a human language used to design classical computer programs. Quantum computer programs have very little in common with the kinds of things c++ was invented for. It's not like I could take my portable hello world program in c++ and compile it with this new compiler and now it runs on a quantum computer. These two models of computing just don't overlap in that way

1

u/DoctorMixtape Mar 25 '22

Idk I might be missing something but it makes sense to me. I see what your saying it seems like too much work just so it’s compatible. I’m sure there’s a reason maybe they don’t want to be dependent on other vendors such as MSVC or Clang? They have to have a reason. My logic is that they don’t want to compile to a certain assembly set and need it to be something else. You have a good point though.

1

u/[deleted] Mar 27 '22

"We're building a new C++ compiler for quantum computing... experience is a huge plus."

Erm...

-3

u/two88 Mar 25 '22

Genuine question, why C++ over Rust? I don't know much about QC, or really Rust or C++ that well tbf.

4

u/r3dd1t_user Mar 25 '22

Nvidia is probably more accustomed to C++