Nathan Killoran: The only way that quantum computing will do well is if we really build up the community as we're building up the hardware. And I think PennyLane really helps with that community building. The fact that anyone who wants to do different things and wants to connect to different devices, they can all use it, and they all can find some common ground there. Eric Anderson: This is Contributor, a podcast telling the stories behind the best open source projects and the communities that make them. I'm Eric Anderson. We're excited to have Nathan Killoran in on the show today. He comes from the company Xanadu and is one of the founding or kind of initial contributors to both Strawberry Fields and PennyLane, and that will be the center of our discussion. Welcome to the show, Nathan. Nathan Killoran: Very happy to be here. Thank you. Eric Anderson: So we'll start this off as we always do, and I want to jump into how Strawberry Fields and PennyLane came to be, but I imagine getting to the story of that might require some backstory on your part. Nathan Killoran: Yeah. So maybe a bit of background. My background is in quantum computing and machine learning. I have some long educational experience. I studied a PhD in quantum computing, and I spent some time both as a researcher in quantum computing and in machine learning. Those were my interests areas. And in the summer of 2017, I kind of found out about this company, Xanadu. It was a new startup company at that time, but it just happened to also be in my home city of Toronto. And they reached out to me and they said, "We're looking for someone to work on something called quantum machine learning," which wasn't really a field at that time. It was just kind of emerging. And now it's kind of really growing in prominence. Nathan Killoran: But in those days there was very few people who really could see both the quantum computing side and the machine learning side at a sufficient level of detail. So they reached out to me and they said, "Come in for an interview," and I thought, well, this is amazing. I never heard of this company, but I've been training myself for a decade for this position that didn't exist when I started school, but now it's suddenly coming open. And when I realized that it was also in my home city, I just had to take that opportunity. So from there I joined Xanadu. We work on quantum computing. I'm now leading the software and algorithms team there. Nathan Killoran: And two of our main software undertakings are software products related to quantum computing called Strawberry Fields and PennyLane. Actually just as a side note, the names come from our CEO, Christian Weedbrook. He doesn't make a lot of contributions to the software, but he gave the names for sure. And he says that the reason is he's a big Beatles fan if you can't tell. Eric Anderson: You can't not like a project named like this. I'm sure you have fans right off the bat, right? Nathan Killoran: Yeah. I remember one of my colleagues went to a conference a year or so ago and they had kind of an informal straw poll of which of the quantum computing had the most interesting branding for the names, and I think Strawberry Fields and PennyLane definitely took the award for that. Eric Anderson: That's awesome. Is Strawberry Fields the right place to start? Nathan Killoran: Yeah, for sure. So that was our first undertaking in the software space. Eric Anderson: Yeah. As you kind of gave us the origin of Strawberry Fields, this is you or others and where did kind of the first idea come from? Nathan Killoran: So it's a team effort. We have a fantastic team. We started small with just a few contributors, but it's grown over time. But initially it was a small team. Very, very early stage startup. We worked in a building that had a... There was some kind of like sewing going on above us all the time. It was some sort of very old garment factory. Sort of your typical startup locale for early days. And the idea of Strawberry Fields is Xanadu is also making quantum computing hardware, so we make a photonic quantum computing chips, and you need to be able to access those somehow. It's not enough to make the hardware. You have to make the access points and the software for users to access it. Nathan Killoran: And photonics is unique enough compared to other potential ways that you could build a quantum computer like superconducting qubits or ion traps or these kinds of things. Basically it needed its own software to access it, and there didn't exist any software for this. And we were the only ones at that time working on kind of commercial photonics undertaking in public like that. So we had to make it. We had to make that software to enable users to access the hardware that we've been building. So that's where that came from. It was just a need that had to be filled. If you want to program a photonic quantum computer, how do you do it? And we provide those tools via Strawberry Fields. Eric Anderson: That make sense. I don't know if operating system is the right analogy, but you had to build something to kind of access the capabilities of the computer. But what's interesting about Strawberry Fields, at least to some degree, is that it's cross platform to a degree, right? It works on other quantum computers as well. Is that right? Nathan Killoran: Actually that's the pitch for PennyLane. Strawberry Fields is very particular to photonics or systems that resemble photonics in their physical description. Eric Anderson: Got it. This was a necessary step and it fell on you and others to kind of figure out how to expose this to the developer? Nathan Killoran: Yup, exactly. Eric Anderson: What does that first effort look like? Is it obvious what the API for such a computer should look like? Nathan Killoran: I will be honest here, we did get the mandates. Not only did we get the name from our CEO, but we got the mandate for what the UI would look like initially. And there was another software package, a open source one, by some people out of Switzerland called ProjectQ. And I guess our CEO Christian, he liked the UI for that one. We were told to emulate that UI. It's a Python software library, but the UI is not very Pythonic at all. Eric Anderson: Got it. And was this smooth sailing from kind of day one? You plug in the CTO's API and you're off to the races? Nathan Killoran: Yeah. It would say it was my first efforts building an actual... Something that resembles a product rather than just an internal bit of code. So it was a learning process for sure. It took us a few months working quietly before we released it. Maybe around six months or so total to create it. So we were basically learning everything as we were going along. We were learning about not only how to interface, but also how to simulate quantum computers and how to write different simulators and include those. We were learning how to test things. We're learning about documentation. We have a very high standard around testing and documentation. So all of that, we had to... Nathan Killoran: Most of the team's coming from a physics background rather than a computer science background, so it's a lot of skills we had to learn on the fly. Eric Anderson: Right. And how do you learn those? I mean, you learn them on the fly. Do you bring other experienced people on board, or you're just on Stack Overflow and Google all day? Nathan Killoran: We did bring in some developers. We had, especially in the early days, a couple of developers who are really good at both the understanding of physics, so they have PhDs and physics, but also some heavy experience with coding. And maybe they weren't developing full software libraries at a commercial scale, but they definitely knew the ins and outs and they could learn very, very quickly. For me personally, I have not much of a background in software originally. I remember various points in my career learning to code in C++ and then completely forgetting it in a month and not needing it again for years. But at some point, it just finally stuck with me right around the time that I switched over and joined Xanadu. Nathan Killoran: Very comfortable in Python, learning Python and doing all the tricks there, but all of the stuff related to software engineering principles, that's very new to a lot of the team. And it's just a matter of educating ourselves, reading books about best practices, and inspecting other people's code. I think open source code is a great way to learn how to do things, not just how to code, but actually how to resolve issues, how to have conversations around the software, how to test things. You can see what other people are doing. You can see the continuous integration services that they're using, and you can try those yourself. Eric Anderson: And was it obvious from the beginning that this should be open source? I mean, I imagine your early users would want some ability to extend as needed, but was there any discussion about making this proprietary? Nathan Killoran: There may have been some discussion, but I don't think it went very far. I think when you're coding in Python, pretty much your source code is always exposed. We didn't really think about it at first too much. Only when we came close to release did we visit those questions. And the way the community was moving more broadly in the quantum computing space was definitely also towards open source, and so we got aligned with that. Eric Anderson: So Nathan, how important are outside contributions to the health of the Strawberry Fields project? And maybe to explain a bit further, my understanding is there's only a handful of people in the world that understand quantum computing to the level that I imagine they would be to be helpful here. Do you know all the contributors? Are these kinds of all people in the industry you're aware of, or do you see people up from the outside and surprise you? Nathan Killoran: We definitely get a lot of surprises. There's people from all over the world who will reach out to us on our public forums or message boards. And you ask yourself like, how did this person find this, right? Definitely there's a high technical level of detail needed for the deepest parts of contributing. There are ways that people can contribute at other levels. We have a really big focus on building community. I think it's really important to build the community. And so we've made efforts to educate people, to tie together tutorials and demos and other sort of educational materials to the code. So they're not just reading source code, but they're actually able to see fully worked examples and then the code with that. Nathan Killoran: And that's kind of a gateway to get people to contribute. Actually today we had three young women who are contributing a new tutorial on quantum machine learning for an online gallery that we keep and two of them are actually in high school. And it's really amazing that we're able to reach an audience at all levels. Eric Anderson: That's incredible. Well, take us through the kind of end of the Strawberry Fields launch and life cycle, wherever it's appropriate to transition to talking about PennyLane. Any other highlights from Strawberry Fields' history to discuss? Nathan Killoran: Yeah, so I think it's about two years ago, we released Strawberry Fields, so it spring 2018. And since then, there's been some study of development, and the biggest developments are to link it to the hardware that Xanadu is building, which is currently in kind of a private beta status with some select partners, but that's the biggest step up that we took was that. But when we finished that first release of Strawberry Fields, what are we going to work on next? And our CEO said to me, "I want to have a quantum machine learning software package." And that's basically the entire mandate, make a software package for quantum machine learning. We think it's going to be really big. We think it's going to be really exciting. Nathan Killoran: And it's a really interesting space, but there's not really any software for it yet. With that mandate given, we went back right after the release of Strawberry Fields and started working on PennyLane, which is the eventual name for the project that we released. I think the initial working name was something called OpenQML, which was maybe not as catchy. That was the code name. That started right after the Strawberry Fields release came out. The story of PennyLane goes back to my first job interview at Xanadu. So I came in for the job interview. There's literally two people in the office, that's how early days it was, and the CEO says to me, "You're coming from a machine learning background. You must know TensorFlow." Nathan Killoran: I said, "Yeah, I know TensorFlow. I use TensorFlow." And he says, "Is there some way to get to TensorFlow to connect to a quantum computer?" And at that time I thought, "Oh, I don't think so. I don't know if it works quite that way," but the seed was planted and that's eventually what grew into PennyLane was the ability to connect all of the tools that are in machine learning to quantum computers. So finding a way to take software like TensorFlow or PyTorch or whatever famous machine learning framework you might like to use and being able to connect that to a quantum computer. That's what PennyLane does. As you alluded to earlier, PennyLane is a cross platform, so it allows you to connect to multiple different quantum computers. Nathan Killoran: This is something that we really like that we can engage with partners across the space, quantum computing space. IBM, you can connect to IBM's online quantum computer. You can connect to Rigetti, which is another big startup in quantum computing. You can connect with their devices via PennyLane. It's got plugins for Microsoft's Quantum Development Kit, for Google's quantum software framework Cirq. And we just released one for a company called Alpine Quantum Technologies, which makes quantum computers in Austria. We really like that feature of PennyLane that you're able to connect to many, many different platforms all from the same place, and it also connects to the machine learning platforms like PyTorch and TensorFlow. Nathan Killoran: So that was from the very first day we started working on PennyLane. The vision I had in my head, that's exactly what it was. Going back to my job interview question, I want to be able to connect to TensorFlow, for instance, to a quantum computer. Eric Anderson: It sounds like a trick interview question no less, and you somehow passed it seems. Nathan Killoran: I think it was more just like a blue sky kind of question. Eric Anderson: Right. Right. Right. Nathan Killoran: With something like this, it wouldn't be possible. Eric Anderson: Yeah, and you're supposed to whiteboard the solution, right, in like two minutes or something. Nathan Killoran: Yeah, exactly. Eric Anderson: And this is exciting in the sense that you could have a real community around PennyLane and get the other startups you mentioned might be excited about having you kind of plug into their systems. Do you get that kind of interaction from the Rigettis of the world and the TensorFlows of the world? Nathan Killoran: Yeah, definitely. We have relationships with a number of the other major players and the other startups in the quantum computing space. And PennyLane has been a great bridge for that because it allows all of these things to exist in one place, right, from user point of view, which is really who you should be thinking of in the end. It's great. You don't have to switch your software to connect with different quantum computer if you only have credentials one month for one and then another month you have a different one. You have access to it's really good. My goal is always to build community. Nathan Killoran: So I think that the only way that quantum computing will do well is if we really build up the community as we're building up the hardware. And I think PennyLane really, really helps with that community building. The fact that anyone who wants to do different things and wants to connect to different devices, they can all use it, and they all can find some common ground there. Eric Anderson: You mentioned this is early days for this sort of thing. There was blue sky discussions. I imagine there's a lot of iteration around what these connections and integrations should look like. And how do you navigate those as you loop in another new partner and they want you to expose or handle things differently? How are those resolutions made? Nathan Killoran: So I would say that it's still early enough that there's not too much divergence in what people are doing. There's still maybe I would say probably two dominant ways you can think of using software in the quantum computing space. So you can either download a software package that someone has made like IBM has a package called Qiskit. Google has one called Cirq. Rigetti has one called PyQuil. So you can download those. They usually come with simulators. They have all sorts of goodies for playing around with quantum computing. So that's one method of interacting with software and quantum computing. And everyone's got their own separate libraries. And the other one is via cloud access. Nathan Killoran: So some companies have built quantum computers and they're available to the cloud either on a free tier or if you have access to other means. And sometimes those are linked to existing software stacks and sometimes they're not. Sometimes they're just exposed via APIs. But I would say that it's pretty uniform. There's not a lot of changes necessary for us from one plugin to another. If you want to connect PennyLane to different platforms, there's not too much divergence. Everyone's kind of marching in the same direction. Eric Anderson: So speaking about one of these partners, TensorFlow, they recently came out with TF Quantum, is that right? Nathan Killoran: That's right. Eric Anderson: And how does that work with Cirq? And there are some similarities there with PennyLane, correct me if I'm wrong? Nathan Killoran: That's right. And actually one of the very first taglines we used to use unofficially for PennyLane to kind of help people understand what it was doing is we called it the TensorFlow of quantum computing. And so it's something that allows you to program as if you were training a neural network. You're programming a quantum computer. So obviously we can't use that unofficial tagline anymore because there is a TensorFlow Quantum. Eric Anderson: Right. Yeah. Nathan Killoran: We have a nice relationship with Google, so I knew that was coming out. And I think it's a great contribution to the space. It shows that more companies are taking this seriously. Xanadu was lucky as a startup. You kind of have to be first, and you have to do things really well in order to get noticed. So we were lucky that we were quick enough moving to get our software out there as quick as possible before everyone starts crowding around. But yeah, it's definitely a very similar flavor I would say in what it does. PennyLane and TensorFlow Quantum are basically meeting the same need, which is connecting a machine learning library to a quantum computing framework. Nathan Killoran: I think the main difference you would notice if you use the two is that so far TensorFlow Quantum only connects TensorFlow to Cirq, which is Google's quantum computing simulator. And I imagine that there's corporate reasons for that. They want to further promote their own packages and their own brands. Luckily with PennyLane, we're not quite tight that way. We like to have a much more agnostic approach. If you don't like TensorFlow, you can connect PyTorch, or you can just code straight in NumPy and you can get all the features there, and you can run on different quantum computing backend. So for instance, Cirq currently it doesn't have any public access to their hardware from Google. Nathan Killoran: So if you want to run on hardware, you shouldn't use TensorFlow Quantum at the moment. I'm sure that'll be coming. That's I would say one of the main differentiators is that the horizontalness of PennyLane across all of the different possible access points. Eric Anderson: How is the roadmap for PennyLane. I mean, it seems like the roadmap for TensorFlow was kind of unending. Is there a similar white space with quantum machine learning? Nathan Killoran: Yeah, definitely. So the way I picture it is that quantum machine learning is just a kind of a bridge to a bigger paradigm. If you're following it all what's happening in deep learning and machine learning, there's this recognition that TensorFlow, for instance, can be used for much more than training a neural network. The kind of things you can do can be much more complex than just textbook algorithms. So you could really be very flexible. You can train a system that has external memory, or you can train or optimize through a differential equation solver, or other sorts of things. You can optimize a graphics engine using the same tools if everything's hooked up correctly. Nathan Killoran: So this is the notion of differentiable programming, recognizing that anything that's been programmed in a certain way, a certain compatible way, with free parameter, so you can use the training algorithms that you would use for deep learning, you can use those to optimize your program as well. So I see that's where the deep learning space is going. They're going beyond just simple neural networks to this larger framework of differential programming, which just says that every program is optimizable. There's always some flexibility and it can always use automatic tools to tune this. And I see the same thing happening in the quantum computing space. Nathan Killoran: So it starts as quantum machine learning because that's a natural starting point. It's something that makes sense to people, but the same tools can be used for quantum computing, for quantum chemistry, for quantum optimization, for any kind of algorithm discovery. You can use the same tool. So I picture it as something called... I call it quantum differentiable programming, so the differential programming of quantum computers. I hope that that's where we're going after just quantum machine learning as we expand the scope of these things to quantum computing more broadly. Eric Anderson: Ah, that's amazing. Will it all be happening, do you imagine, under the PennyLane umbrella, or will there be a Hey Jude for chemistry and so forth? Nathan Killoran: Yeah, I think we'll stick with just the PennyLane branding. You don't want to dilute things too much. Eric Anderson: There's copyright infringement, I suppose, at some point as well. That's the vision is that these things are so similar to machine learning, you're saying, that it's really just differential computing in the end. And so you're reusing the same tool set with a little bit of augmentation for these new domains. Is that right? Nathan Killoran: Exactly. Exactly. So recognizing that the tools are much more applicable than to just smaller domain and they can be applied to much wider domain. And I think that's where deep learning will go, and I think that's where quantum computing will go. Eric Anderson: What does that mean for the PennyLane project? I mean, this is largely Xanadu kind of workforce today with some outside contributors. Is there a hope or vision that there's eventually a PennyLane conference and this is kind of central to the way we do differential computing in the future? Nathan Killoran: Yeah. I mean, that'd be fantastic. As you mentioned, we're currently still kind of incubating the project with Xanadu as the parent organization, but definitely in the longer term, we would like to potentially shift to more of a standalone entity and getting official support and buy in from industry from a wider group of institutions. That'd be fantastic. Eric Anderson: On the show, we often talk to people who've had to go through the decision to put this in some kind of foundation, an open source foundation, Apache or CNCF. Is there a place that exists today where this would seem like a natural home, or is that something that is still unclear? Nathan Killoran: I'd say that we're just starting to see these kind of opportunities being available in the quantum space. Obviously there's legacy institutions like Apache or NumFOCUS that we could go to, but they're not really quantum computing focused at all. So if you wanted a similar thing for quantum computing. There's one that's just emerging. It's called the Unitary Fund. And they're a nonprofit devoted to quantum software, and they currently fund projects, give micro grants for people to work on small scale projects. So that kind of thing. As that grows, it might be a natural landing point. Eric Anderson: So quantum computing feels to some as far out and maybe not quite here yet and machine learning, quantum machine learning, no less feels like it could be even further far out, or is quantum machine learning may be one of the first use cases for quantum. Does that make sense? Nathan Killoran: Yeah, definitely. I mean, we have the intersection of two big buzzwords here. So there could just be vaporware, but there is actually a sense that these algorithms that are emerging from quantum machine learning in the last couple of years from this perspective of being able to optimize quantum circuits, these might actually be the best opportunities to unlock those first tier of applications that might be of broader interest to society as quantum computers grow. And the reason being is that... Well, there's two reasons I would say that make me bullish in this idea. So the first one is that machine learning algorithms naturally work with the device you have. Nathan Killoran: So if there's imperfections in the device, they can potentially adjust for that. You don't have to necessarily account for it in your algorithm design. You can adjust for it using the optimization of machine learning algorithms. The second thing that that makes me optimistic is that I think when you move away from experts hand designing algorithms, then you adopt an approach where you can find algorithms by optimization. I think that opens a lot bigger, a lot quicker opportunities to search the space of possible algorithms. So using these tools that come from machine learning allows us to iterate much more quickly through the possible uses of device than if you had to... Nathan Killoran: Back when I was a grad student, I had to write things on pen and paper or on a whiteboard to design algorithms. And now we can just be a lot more flexible in our structure of our algorithms and use optimization tools for machine learning to fine tune them. Eric Anderson: So while the double buzzword is there, this may be the most pragmatic place if you wanted to get involved in quantum and feel like there's a near term chance of making a difference. PennyLane is not a bad place to be. Nathan Killoran: Yeah. I mean, I think there's lots of cool opportunities in the quantum space. And no matter what someone's interest is, there's the potential to contribute. But certainly I'm very excited about quantum machine learning optimization, differential programming, and that's why we put all this effort into PennyLane. Eric Anderson: Well, we, speaking of contributor and its audience, would love to put some oomph behind PennyLane, where are the needs for the project, where are you looking for help from contributions, from community, that sort of thing. Nathan Killoran: I think there's opportunities at all levels to contribute. So we always welcome people who want to contribute code. The technical barriers may be a bit higher there because he would have to be good at both the physics, the quantum physics, and also at the software engineering. But there's also ways for people to contribute their manners. So we have a website, pennylane.ai, and we host on there a lot of tutorials and educational materials and demonstrations of different quantum computing and quantum machine learning algorithms. And we accept contributions there as well. So you don't necessarily have to be someone who's writing source code. Nathan Killoran: As long as you know how to use the code that someone else has made for cool purposes and you can show off uses of the code in nice ways, then that's always open for contributions as well. And as we grow, we would love also to get contributions on bigger things. You mentioned a PennyLane conference. That's the dream. If we have people who are contributing to an opensource product not just as coders, but as promoters or educators or organizers, that would be fantastic. Eric Anderson: I suppose we have a few months before anybody's going to be gathering in large groups, so we have some time to plan this thing. Nathan Killoran: That's right. Eric Anderson: You mentioned these high schoolers. It sounds like there's a place to get started if you don't have a PhD in quantum in these projects, and you can just jump into the website, go through some tutorials, and extend them from there. Nathan Killoran: That's right. And I should call out the contributors who just contributed to those tutorials. They're part of a mentorship program by something called the Quantum Open Source Foundation, which is run by some colleagues of ours. And they have this mentorship program, which connects people who are interested in getting to the quantum space with leaders or people who are in industry and they can provide guidance. And I think that's exactly where those two young women got that opportunity. Eric Anderson: That's right. As we wrap this up, is there a next project on the horizon, or are you squarely focused on PennyLane for now? Nathan Killoran: I think for sure PennyLane is the main focus for us right now. We're seeing a lot of momentum, especially in the last six months or so, and we just want to really roll with that. So PennyLane will be our big focus in the near term for sure, but you never know. All it takes is one blue sky question to start making you think about something new. Eric Anderson: Yeah. You have to hire some more folks and have these more compelling interview questions. Nathan Killoran: Yeah, we definitely have done that. We've got a fantastic team, and I'd be remiss if I didn't say like a lot of the success of PennyLane is due to our fantastic team that's been developing it the last two years. Eric Anderson: Fantastic. Thank you so much, Nathan, for joining us today. Both Strawberry Fields and PennyLane are exciting. And it's awesome to know that while you come from a narrow set of experience with a PhD and years in quantum, there's a door for the rest of us to get started and lend a hand. Thank you for coming on the show. Nathan Killoran: Yeah, absolutely. It's been my pleasure. Eric Anderson: You can find today's show notes and past episodes at contributor.fyi. until next time, I'm Eric Anderson and this has been Contributor.