Well, guys, thanks a lot of those who turned out. We'll sort of jump in variety into things. So I'm Toby Norman. I'm actually up here with my brother. We're going to be talking about Simprints, which is a biometric project that works in developing countries, trying to solve a challenge, a hacking for good challenge that we came across about two years ago. And so what we're hoping to do is talk to sort of do three things. We'll talk about the biometrics for the developing world, which is both interesting, sometimes controversial, but really cool. To talk about what it is like to tap into hacker communities and get help from hackers, building something that actually a lot of the digital musicians hadn't been working on, and hopefully share some sort of tips and lessons that we learned along the path of doing that. And then the third thing is talk about a couple of challenges that we're facing at the next stage of the project and maybe get some of your input and some of your thoughts about how to solve those challenges. So let's dive right into what was the problem that got us started on this YouTube slide. So very quickly, this is, Simprints started as a student project at the University of Cambridge about two years ago, but really picked up steam, about in the past nine months or so. And the mission of the project was really about building technology for development, so hacking for good. How could we use some of the engineering, how could we use some of the hacking interest around it? Can we reach for actually solving real world problems and not just problems in the UK but global problems? Next slide. So what's the problem? So I actually don't come from a hacking or an engineering background. I've been working in global health for about the past seven years in different capacities. First in Africa, then in Central and South America, and most recently in Asia and Bangladesh, where I've been doing my doctoral research for the past three years. The problem that we run consistently in the field, particularly in global health care, is the question around identification. So as you guys know, mobile has penetrated the world in an incredible way. There's more mobile phones now on the planet, and there are people. It's just getting more and more amount of data is increasing. Huge amounts of people have access to mobile phones, which is a mission that's really cool way of mobile technologies. Everything around mobile health care, mobile finances, the government services, lots of cool stuff in mobile space. And one of the challenges we have, particularly the very resourceful setting, so places like where I work in Bangladesh, places where people often have weak government institutions, is actually linking people to these digital records, these mobile records. So you might have an awesome mobile health care application, but if you don't have a unique ID to connect them to those records, the mobile tool is useless. It doesn't work. And this is very common in places where people often get quite remote. Populations can be really poor. You literally can be low. No one has things like passports, government machines like the driver's license and stuff we have. Or any type of NHS number, natural insurance number, things like that. So if we were typically using the way to resolve this problem. And so what we have is really cool mobile tools that are coming up. So NHS tools and diagnostic tools, new tools for TV, HIV, malaria, clinical research. There's a bottleneck that's caused by the lack of a unique ID that UID needs to link people digitally to their records and get the most out of these new tools and do the most good for these new tools. And so that was the challenge. That's been a big bottleneck. That's how we got involved in this project and the challenge we want to see if we could solve and do some hacking around Cambridge. So how do you do that? It's like that. So the thought was, alright, these awesome tools exist. What is a great unique ID that people have that's consistent and that it's not something they can use that's with them all the time? And the other thing is biometrics. We all have biometrics IDs. There's different types. There's iOS, there's voice, there's facial recognition. And the one we're looking at on this project is finger print. So the challenge at the moment, if you're working with paper records or paper unique IDs, you're going to run into a whole bunch of problems in the field. And many of these problems aren't going to work for the last 40 years. So for example, paper IDs like vaccination cards often get lost or damaged in the field.   And the chance of that mother having that card and not having lost it or getting damaged and having discretion inside the gardens is pretty high. So this is one of the challenges with paper IDs. The biometrics IDs do get paper prints awesome.  They're available since they were born. It's something you'll have your whole life. Second, often non-unique. So big problems, particularly in medical records, is you get duplicates. The IDs come non-unique. You enter different, you see a person twice.  Whereas fingerprint IDs are unique, you can match with a single fingerprint up to 10,000 individuals from that. Multiple finger prints, the scope just gets bigger and bigger. And part of the big problem where I work is that records can be fake. So sometimes records can be fake. So sometimes, particularly when you have subsea programs, we have programs where there's money involved or some type of government service involved, you can use it to actually fake the records. There's a lot of corruption in places where we were in Bangladesh or in India where you don't want that and you want to find new tools to fight against that corruption and fight against people taking IDs or claiming that they're giving services, but they haven't actually given it in the field. Fingerprint IDs are really tough to fake unless you have career-sophisticated tools to do that. That's that. Good example of this. So an area I work in, maternal health care, right? So if you're a momentary development country and you live in, say, a remote village somewhere in Bangladesh, in northern Bangladesh, what you're supposed to do is if you get pregnant, put into the World Health Organization, hopefully you're going to get seen by health workers about four times before you get birth. And it's during this visit that health workers catch a lot of the stuff that makes pregnancy really dangerous, from the signs of preecrancy or the things that can kill you when you get birth. What actually suddenly happened in the field is that happens quite rarely. You get all of the health worker visits you're supposed to get. You're supposed to get four visits, only about 40% of all pregnant months in the world, especially the real four ones, get those visits. And the challenges are one, misidentification, so finding months you don't have any records, and two, verification. So actually knowing that the community health workers have seen the right months and you've got tools to verify that that visits actually happened. And so what we said is what if we came together and used a biometric project to build something that was easy, simple, and as open-source as possible, but could plug into the existing health tools, allowing them to overcome these challenges of misidentification and verification. And so the first thing we said is, all right, this sounds like a good idea. Surely someone's done it, right? Then it must be the biometric tool that exists out there somewhere to realize you do it. So you should be able to buy a scan on the shelf, create some software, plug it in, problem solve. And so we spent a lot of time looking for scanners that would fit the bill. And what it's going to be is it's going to be something that's ruggedized because we're pretty tough, right? You're going to take this monsoon to Bangladesh or in the sand storms in the Kalahar desert or all over the world, and create tough circumstances. It's going to be something that's low cost, right? You cannot afford a $500 at the other compliant scanner when you're trying to do this with really resourceful settings. So a community health worker that's just where you don't have a lot of money. And ideally, it's going to be something that's open-source and can plug into lots of different phones. Because although everyone has phones, there are lots of different types of phones, lots of different types of platforms. It's not going to do any good if you just design it in a blackberry or one type of system. You want it really easy for developers to plug into different mobiles of their platforms. And when we actually looked for these weird things, we found that the scanners that existed on the market were actually really bad at this. They're either inaccurate, so it's just a little securities camera that you have on iPhone. They're either like an iPhone, so they're super expensive. You know, they pay $500 or $500 a piece. Often in mobile, so the things that you have to plug in with a USB to a laptop, which isn't going to happen in a place like Vancouver. We're not everyone's going to have a laptop. Bad design in form factor, non-rugged eyes. Optimist software algorithms charge per stand, so it's going to get super expensive before health organizations to actually get the stands matched to your fingerprints. And difficult to integrate in systems. A lot of the stuff in the space is closed. A lot of the stuff is proprietary. And that's going to make it top of debt to integrators at work they do. And so the question was, all right, clearly we've got to build two things. We've got to build one of three different scanner that connects wireless into mobile phones. It's got to be low cost, so we're in between $30 and $50. It's got to integrate eZwings and other projects. It's got to be wireless, ruggedized, waterproof, and one that's becoming increasingly important. It's got to have a long battery life. Most people in the developing world do charge their phones, but they don't get to charge it actually every day or every night. It's not as easy on how to make power out of it, so it's got to have a long battery life for the last at least as long as the phones people are working within the field. And it wasn't just the hardware you have to figure out. You've got to figure out the software as well. An open source matching algorithm, an open source API, it's got to be interoperable with other scanners and plug in easily to the existing tools. No point in just building an app when there are tons of good apps but it already exists out there. It's like... So Chius, why don't you tell us a little more about what we actually built? Yeah, great. So this is jumping into what we've actually built, how the system works. This is a little bit more of my background. I'm a software developer. So we focused, as Toby said, on two areas. We have to build a scanner and then we have to build some software that accompanies that scanner. So what we've done is we have taken some existing fingerprint modules already, something that's capable of actually taking the image of a fingerprint and breaking this down to a template and then putting this into essentially a very rugged unit that has a battery and Bluetooth. So these things can be synced to very simple phones any really cheap, affordable Android phone and then the Android phone can really be your platform. So we focused on rugged and low cost and then inside the scanner itself what we do is we're able to swipe the finger, break this down into a template and then we pass this template over to the Android phone and on this step is where we can do the identification. So a person's fingerprint is unique but what we do is every time you look at an image as you can imagine every image is going to be slightly different. So we find this template and this template will have these unique points that you then compare to the pre-existing templates and that's essentially how you do a very simple fingerprint match. And we can able to do this on the phone itself. So you can have a list of templates sitting on the phone. You can have a list of unique IDs that are generated that match with these patients and then on the phone you can find which is the right patient and pull up this unique ID. Using this unique ID we're able to then connect it to patient records. So whatever application that you're plugging this into if they have an existing EMS system or medical record system of some kind they're going to have a unique ID that's tied in with each of their patients. So when you connect this global unique identifier to that patient you're able to essentially use the template to find the global unique identifier which can then confine the patient's records. So here's a little peek inside of the scanner itself. It's actually a very simple process but this is one of the things that we want to focus on making it very streamlined, make it very cheap, make it very affordable. So we have a fingerprint sensor that connects to a microcontroller which we're currently doing on embed and working with an arm. And then on here we run the extraction. So we take the image of the finger and then we break it down into the minutiae, the unique points which gives us the fingerprint template. And then the microcontroller passes this to the Bluetooth module and then this Bluetooth module can just pass it to the Android phone. We're building the API right now to allow people to either build these steps into their own application on Android so they can just connect to the scanner, request the template to get from the scanner and then bring it in. Or just building an app that people will be able to essentially take it, pull it apart and then do that process themselves. And then we'll have an open source API. So there's two ways to do identification currently with the fingerprint. As you can imagine, when you have 10,000 fingerprints out of one out of that, that's a very resource-intensive process to do. So on these really cheap Android phones it's very, very slow. The fastest thing to do is actually make a cloud-based matching system so that it can then send the template up to the cloud, use all the resources in the cloud, use extra cores in the cloud, do the matching, find the correct UID, send that UID back to the phone and then keep going on the process. So that's the second step that we do. So you can match natively on the phone a little pool of fingerprints on there, but if you have too many and it's too slow or the device doesn't have enough cores, doesn't have enough power in it, then you can send it up to the cloud and it takes less resources, it's faster. And then this is essentially where it goes and plugs into the existing M-Health apps. So when this unique ID is returned it's passed over to the M-Health app that's either on the phone or it could be another cloud-based system and they can use that to then go and whenever you talk about biometrics you have to cover security. And so one of the things that we want to make sure is that people weren't nervous of okay, you're taking biometric information, you're passing it to the cloud, you're passing it to essentially Android phones that people can get a hold of, how do you keep this secure? Now there's a couple steps in the security that make it pretty simple, pretty straightforward and pretty secure as biometrics go. So the first one is that the fingerprint image never leaves the scanner itself. So inside the scanner we take the image we turn it into a template and then the image is destroyed and the template is the only thing that's sent over. And this is important because these extracted templates can't be reverse engineered into a fingerprint, so they can be used for matching they can be used for pulling up a global unique identifier but they can't be turned back into someone's fingerprint.  The other nice thing about Bluetooth is that you could probably throw a stone further than you could connect to Bluetooth and at least reliably. So a lot of the rural places that will be working and it will be a bit suspicious if you have a community health worker in a field you have a Bluetooth scanner and then there's a guy 30 meters away from him with a laptop people will probably notice that. So there's another security step right there. And then I think the most important security step is that the cloud-based matching all that's being held inside of the cloud-based matching is a unique ID and a template. So if you were to intercept that, if you were to go in and find the template that was associated with this unique ID the unique ID isn't a key or isn't access to the third party's medical record system. So you would have to come in, you'd have to find that unique ID and then you'd have to go and then re-break into the existing medical record system, use that unique ID to find that patient's records and it would be a bit of a waste of time. Your time would be to spend just breaking into ODK's system and finding that or breaking into a BRAC system and getting their medical records that way. So those two are linked essentially through that one step that unique ID doesn't give access so everyone can secure their system with their patient records their own way. So, yep, essentially that is the sort of basics of the security that we have behind that. So currently you're using some tools that I'm sure a lot of you are very familiar with so our first one was really using an Arduino board and it was just sitting on top of a breadboard and what we did is we took a UPEC fingerprint scanner and we plugged into the breadboard and we plugged into an Arduino board and then we've had some very kind engineers from ARM helping us do the embedded code and then just essentially handing that Bluetooth connection over to the Android and then building an app that can essentially communicate with the scanner. Now we're building our own PCBs and as you can actually see in the bottom of the screen this is one of the first iterations of our PCB so you can recognize in the top right there's a little Bluetooth module and then the microcontroller is sitting right in the middle there and then the piece connected to it is the UPEC scanner. So that's essentially what we're looking at right now. We'll be using some raspberry pies in the future to test out a few fingerprint modules, see which ones have more accurate templates, those kinds of things. So this is essentially what we're working with. A quick shout out to MakeSpace. I can see a few MakeSpace members here. Yep, a lot of our work is done in MakeSpace so we bug these guys frequently when we need to sort out a small problem and we're always in there stealing tools trying to hack things together. It's been a very scrapped together process but it's been great. So the other step that we looked at was the casing design. So one of the things that you have to consider when you have a casing design is it has to be easy for people to use. So we went out into the field in Bangladesh to test a swipe scanner. So one that you'd kind of have on your laptop or one that you get on these new Android tablets and you know we were very interested to see people in the office love the square design that we had. It looks very much like an iPhone. They think that looks very official. This is great but when we actually brought it out to the people in the field and said oh could you swipe your finger on this they kind of look at us and go and push it on top of the device and they had a really difficult time trying to essentially get that fingerprint precisely on where you need it. So we're looking at and building essentially ways of doing this in a smoother process. How can we make scanning go a little bit smoother? How can we make this more user friendly? The user experience they have to be able to look at it and say I don't understand how I use this device. There we go. So this is one of the really interesting things that we found when we were field testing in Bangladesh is essentially where is it going to be more useful? Is it going to be more useful if it's connected to a desk if you're talking about a hospital setting or an administration setting? Or a lot of cases the people who this device will be using it aren't actually sitting so the community health worker will be interacting with them but they will be wandering around they will be doing chores, they will be doing field work they will be doing these kinds of things and so how can you have a device that's capable of keeping up with them and this is one of the things we really looked at in the youth, these kinds of things and then another thing is finger flexibility so a lot of people sort of get limited finger flexibility after years and years of field work so you can't have a thick device sitting on a table that then this person has to really bend their thumb up and get the scan on so it needs to be thin, it needs to be mobile, it needs to be easy for the community health worker to use and then also you need to be able to go into sort of no connection scenarios so there's another part of the software the reason that we don't just do the cloud based matching but we do the local matching on the android is because the network connections they're getting really good out there but they go down very frequently so you don't want to be stuck in a scenario where you have to wait for 20 minutes for the network to come back online or to be able to connect to the cellular data again to get up there so you want to be able to keep going from where you are so yeah I'm going to pass it back to Tobi talk about sort of what our results were what we found but big things we found in this project essentially trying to hack one take to the feed the second, if you were trying to convince people to either give you money or give you resources to give you support collect data like crazy you know because we could talk to folks about what we had seen and we could talk to folks about what we believed was going to work and if you're going to try and hack something better people who are going to support that really really want to see data and they want to see good data backing up okay we've tested this we've built something, how does it work and the big thing for us was just training out as fast as possible what are the biometric industry standards and are these prototypes meeting that and so these are some of the rock curves and if folks are interested in biometrics come grab us up and talk and we can take more into that but a big thing was just building the right curves that industry folks would expect to see and figuring out where we placed on that and here we're seeing an equal average of about 3.4% which actually is pretty good for them first prototype that's actually surprisingly good for where we'd be and we found out really early too that when you're trying to do fingerprints what you need is large images and so the best two fingers by a long shot are going to be your thumb and your forefinger all of the images we're getting out of the last three fingers rubbish and that's stuff that we had to find by being in the field but also just being methodical about the way we collect the data and the way we analyze the data and that's been a huge help in driving the project forward and convincing folks to support it because that was a big lesson going through this so yeah another thing to do when you're really looking at building a hack project like this is the community that you need to work with because obviously you can't do every step of this process you can't build the thing that's going to capture the image you can't build the algorithm that turns that image into a template you don't want to end up being the one who has to build the algorithm to match all these templates how do you connect these resources and then there's all the embedded code that you have to write there's all the soldering that you have to do on your PCB the next step is really finding where you're going to be and luckily we're in Cambridge so we have make space as we said earlier which is phenomenal and being members of environments like that how do you do your design who's going to build the initial board how are you going to build a case for that board who's going to help you do these things so that was essentially a really big step that is worth looking into and finding yourself in make space which is a great thing and it's been a huge joy for us as well how to get it off the ground so we are very lucky and we've just been essentially received our seed funding from the Bill and Linda Gates Foundation and from USAID but looking for how do you find resources and one of the big things is all HAC projects can secede but you need to find essentially who are the funders out there who are interested in your space who are interested in your technology but also their beliefs and their visions align with yours so you're looking for people who approve of open source systems people who don't mind that things that are no should be proprietary and you should be getting IP on if you want investment they're impact investors they're really looking for no we are actually interested in investing in people who will have a large impact and we see that this technology is going to be able to reach a lot of fields, a lot of people and have a large impact on that so essentially getting aligned and finding out who out there has money is interested in essentially giving that money to have impact and then essentially start mastering those people which is what we did and it's been reasonably successful up until now so which is good and then finally keeping an open mind to applications that maybe you never thought of this is something when we came into this we came into purely for the mobile hub that's our passion global hub background this is what we want to do and what we're going to do but in doing the process and talking to lots of people about the idea sometimes folks come up with applications that we didn't even think existed the first time around for example one is micro finance so really small loans for people who don't have bank accounts using it to track and verify those loans using biometrics or refugees and IDP services so people who are really migratory and it's hard work to connect them to either their health records or to their organizations like UNICEF or UNHCR for working with refugees connecting these people to services we didn't even think about that when we started the project there were a lot of folks and it came up anti-corruption efforts reducing fraud that happened in the year of the time poverty research academics that actually wanted to link people to research winning people the information aiding farmers ways that you can use this to help connect farm workers or actually farm owners to different government services in terms of stuff that we didn't plan but when you talk to smart people and interact with smart people sometimes you'll be made with what comes out of the blue thank you very much for coming to the presentation and we're very happy to do a little Q&A at the end here so if anyone has any questions any follow-ups anything they want to know


I think today we will finish this part on quantum harmonic chain and then we will consider the quantumism model. This is a recap, but there is also something new about what we did yesterday. At least I changed a bit the notations, because yesterday with all the indices in the end it was a bit messy, so maybe it's better to use a vector notation. It's easier. OK, so we consider this a system of harmonicos letters. This system can model the movement of ions in some crystal, and in particular we just for the sake of simplicity, we imposed three-order boundary conditions, which means that the variable n plus one is equivalent to the variable at one. And OK, this is the Hamiltonian of the of the model. The i is the conjugate momentum of Xi, so they satisfy this combination relation, h bar is equal to one. Then, OK, let's introduce this kind of vector notations. We have n momenta and then coordinate position, so we can collect them in some vector. And I define this vector p hat, and this is the same for the x. Now, using this notation, it is kind of simple to show that the Hamiltonian is written this way. So you have a scalar product within these two vectors. In the scalar product, we have to multiply each element by itself squared, so it becomes p squared and so on. And then, instead, the other part is just given by the vector of x, the scalar product with the cx, where c is the matrix that I introduced yesterday. Why you find this matrix? Because if you expand the square here, you have x squared minus y xi xi plus one plus xi plus one squared. But then you have to consider that you get to consider all the contribution from both from i and i minus one. So you find the you want to see it or you are happy with the Hamiltonian and we can go. You want to see how this matrix arises or it's OK? I think it's OK. So this is our, or maybe there is a, I hope there is no wrong factor here. Let's check it, OK? Just to be sure, because now I'm not sure anymore about the factor. So if you write this term of the Hamiltonian, you have a sum over i of xi minus xi plus one squared. This equals sum over i of xi squared plus xi plus one squared minus twice xi xi plus one. So here this, this term is just the x. The second term is the same because we are just shifting the index. So we find twice x vector x minus sum over x of this. Sum over, over i, sorry, twice xi xi plus one. So our matrix, so if we, if you write this as x, scalar, some matrix applied to x, one xn. What we find, we find that the diagonal should be equal to one, two, two, because we are a scalar product. And then here there is a minus twice xi xi plus one, but in which can be written as minus xi. We can write this term as minus sum over i of xi xi plus one plus xi xi minus one. And so we have to minus one minus one. So partly this was correct. I guess it's the correct form. So this is the, I can erase this, no? It was just a check, because I wasn't sure.  It's a bit better. And then, okay, we, we try to find the excitation energies and the spectrum of the Hamiltonian. And we, the idea was to use the same formalism that we use in for the case of a single harmonic oscillator. So this ladder formalism. So the idea is to introduce some operators which are linear combination of the coordinates of the problem x and p. And then we impose that the commutator between the Hamiltonian and this operator, which can depend on some. This is just an index because, in principle, we can find more of these operators for the single harmonic oscillator. We are just one operators, but in this case, because we have a chain, we can expect that there are many of them. So we, the idea is to impose that the commutator between the Hamiltonian and this operator is proportional to the operator itself. Why do we do this? Because if you are able to find this operator and using both this relation and this other relation, which, which is essentially the conjugate of this one. So they are related. Then you find immediately that the ground state should be such that the is annihilated by all this operator, a case. Why? Because when you apply these operators to a 20 set of states, you find that the energy becomes lower. And it's lower by action k, which is by definition a positive. So this means that the ground state is determined by this condition. Analyze all the operators. But okay, we don't know only what is the ground state. We also can construct it. Yes, because of this. Okay, okay, okay. To be a letter for blackboard. Okay, so this is the ground state. What about the excited states? Because when you apply this later operator, a decade to an excited state to an idea state of the amuletona, what you find is that you find another state of the amuletona with energy, which is the same as before plus epsilon k. So in other words, we can construct all these excited state by apply this later operator to the ground state. So this is the idea, the general idea, but then, okay, we started doing the calculation yesterday and get some problems with the indices. Okay, but okay, and now we can completely this calculation, I guess. Okay, so we we have to impose the commutator between these and these are you finding innovations? These are just vectors. These are numbers. Okay, maybe if you prefer, I can change this the symbols here because I use X and P like the coordinates and maybe it's confusing. If you prefer, I change them. I do not because I didn't do that because I started with this notation, but are you fine if I change that? Okay, so let's call this you. Let's call this.  Now, the reason why I'm choosing this name, you see, that is a linear combination and these two are different dimensions, P and X. So the idea is to write some letter here, which reminds me that they should have the dimension, for example, you have a length and you have the moment. Just to be sure is a check is a fellow check in the end of the calculation and I can I can see the dimension if they are right only for that. Okay, so we want to impose this constraint. What do we find? We find the following equation and times another way to change all the Q and vector plus Y and scalar product with P. This is equal to minus I, not P is Q, Q and divided by M plus one over four I, M omega squared C. Okay, now let's go one over four, omega squared C, not C, Y, M. It's how can you derive this? Actually, you know, it's kind of simple. You just have to take the derivative if you want in a with respect to the variable P and X. You can do it with the indices if you want, but this is essentially the just a quick trick to the end result. So we we have this equation and you have to solve it. This is just imposing. I am posting this using those notations. So how can we first of all, what does it mean here? You see that there's a linear combination X and P, but here and here. So the only way to satisfy this equation is that all the coefficients for X and P separately are equal on the left hand side on the right hand side. So this imply this question that epsilon and Q and should be equal to one over four I, M, omega squared C, Y and this is one question. Then we have the other question for the momentum. Epsilon n, Y n is equal to minus i Q and over M. And these are probably the questions that I wrote yesterday in the end. OK, so well, then OK, what do you want? We can now I don't really mind such. OK, maybe we should do this. OK, so I think I can erase everything. OK, so we have this question to solve, but actually we also would like to impose a normalization for this operator. Because you see this equation are invariant under where you can multiply this equation by a constant and you obtain the same. So we want to fix the normalization. And the way to fix the normalization is to impose that a dot a k, a dot k is equal to one, which is the same relation that we had for the harmonic oscillator. OK, so first of all, let's let's let's fix the normalization and see what what is this condition. This condition means that one should be equal to the commutator between. Hey, is the conjugate? Yes, yes, exactly. This is what we are going to do in a moment. And just OK, before solving this, there is another constraint given by the fact that this operator we can fix the normalization away. And it's convenient to fix the normalization. Such way that this is equal to one. OK, so my session is that this is so this is the conjugate of this. So this means that you have to take here the conjugate of this coefficient, the conjugate of the other coefficient. So you have the one should be equal to P and star vector scalar. Oh, there is no P. Sorry, this is called Q. Then a plus Y n star scalar P commutator with Q, n, Y, Y, not Y, X, and X plus Y n scalar P to be equal to one. Now the X variable commute P variables commute one another. So you have to take into account the commutator between X and P and P and X. We know that the commutator being X and P is proportional to a delta. So it gives rise to the scalar product of the coefficient. So we have one should be equal to Q. There is an eye. I because the commutator between X and P is equal to I. So we have Q star scalar product Y n minus Y n star scalar Q n should be equal to one. Why? Yeah, there is a minus because we have the commutator between P and X, which is minus I is not equal to Y. So this is our, this is normalization, normalization of the operator. You have this condition that we will impose and then we have to solve the other two questions. OK, let's not solve these equations. What can I do? OK, we can, for example, what I do, what I do here. So we could plug and choose. So we can plug, for example, view the first equation into the second one. So this means let's assume now that epsilon n different from zero. OK, if you assume epsilon n, epsilon k, epsilon n different from zero. So we can divide by epsilon n. So we find Q n equal to the expression divided by epsilon n. We plug Q n here. What do we find? Epsilon n, Y n, is equal to minus I over m epsilon n for I omega squared C Y n. OK, we'll find this, if I find this correct. So this can be written as C y n if you multiply by this coefficient. It is equal to 4 epsilon n squared over omega squared Y n. So we have to solve this equation. How do we solve this equation? As I told you yesterday, this is a circular matrix. And because of the symmetry, you can diagonalize this matrix in Korea, in full space, essentially. So this means that the eigenvectors are given by E to the I. So you have that C. OK, let's write this matrix. You can write this C l n in this form, 1 over n. We go in the free space, OK? 1 over n sum over j. It goes from 1 to n of E to the 2 pi i j l minus n over capital N. And here we put some coefficient, which is called C tilde j, if you want. So because of the properties of this matrix, we can actually rewrite the matrix in this form. And so we just have to determine which are the coefficients C j. Then C j, we know that in particular, OK, let's write C instead of C j C of 2 pi j over n. So what we have, if we find that the C tilde of 2 pi j over n is equal to 2. Yes? What's written in? In the x-point, OK, that is 2 pi i j, this is a j, multiplied by l minus n, and everything divided by capital N. What is this? This is a discrete free transform, because the size of the matrix is n, and you see this is periodic. And we're just going in the free space. And it depends on the difference of the indices, just because this matrix depends only on the difference of the indices. And there is this condition of periodicity. So we can find this C tilde. C tilde will be equal to 2, because when you replace C tilde by a constant, you find that the sum of phases. And the sum of phases is equal to is non-zero only if the phase is equal to 1, if the phase is 0. So you find the condition that corresponds to the first diagonal of the matrix, these two. Then you have to take into account the other diagonals. So you obtain minus 2 cosine of 2 pi j over n. Why is this the case? Because if you expand to cosine, you have e to the i, the first plus e to the minus i. The same. So now the condition becomes l minus n should be equal to plus 1 or minus 1, which is exactly what we have here. This is the minus sign. Up here, yes. So this is just another way to write the matrix C. See how this is equal to this? You can verify. That's the case. So we were interested in the eigenvalues of C, no? So let's forget it. OK, maybe it's better if I try to write this question somewhere here, normalization. OK, if you want to just get this matrix, you notice that it's just tilde. Yes? How do you do that thing? OK, if you want to do the anti-fuelet transform, but I just guess the solution because it's kind of intuitive. So let's imagine to expand this in all the Fourier coefficients. See, you have the generic coefficient which have this form e to the i to pi j over n times some integer. No, not l maybe, some integer m. Then you have to sum all the spaces. But again, in order to be different from 0, the space should cancel. So this means that l minus n plus j should be equal to 0. So this means that this mth Fourier coefficients contribute as the mth column of the matrix. You can just keep the first coefficient, the first e to the i phi. I have to see because we are just a tri-diagonal, more or less the diagonal matrix. But OK, you compute the anti-fuelet transform as a part. That's not so. OK, so we have a normalization there. So now that we wrote this matrix in this form, it's easier to diagonalize it because we have is that the eigenvectors are of the form vn equal to vk eigenvectors, coordinate j is equal to e is proportional to e to the 2 pi ijk over n. Let me be with the cross sign. So we just use the sunsets, which is equivalent to consider Fourier transform. And then we apply c ln, our matrix c, to the vector vk. And we suppose that this is an eigenstate. And what do we find? We find that we sum over the indices. We write all the indices. So we have sum over n of c ln times vk of n should be equal to lambda vk of n over l. That's what we have to solve. Now we use that representation there. So we have sum. This n is from 1 to capital N. And from 1 to capital N, we have 1 over capital N sum over j. It goes from 1 to n of e to the 2 pi ij over capital N l minus n. There is c tilde after that. So we have this contribution. e to the 2 pi i nk over capital N. Then we have c tilde of 2 pi j over capital C is equal to our eigenvalue of lambda k times vk l, which is e to the 2 pi i lk over capital N. That's it. We have to solve this. Now again, here there is the sum over n. If you consider the sum over j, there is also this contribution that we don't like. But we first can consider sum over n. When you sum over n, you have n only on the phases. So again, we can use that the sum of phases is equal to is non-zero only if the phase cancels. So this means that j should be equal to k. And you get the factor of capital N. So this becomes capital N and simplifies this. So you remain with sum from j that goes from 1 to n of e to the 2 pi i j l over capital N. Then you have c tilde. There is a delta k, sorry, j equal k. So here is a k. It's 2 pi k over capital N, which is equal to lambda k e to the 2 pi i lk over capital N. We guess well, you see? Because now we have that, indeed, these two terms. This is consistent with the c tilde to pi k over capital N equal lambda k. Yes, OK? So we have this equation, fine? Now we sum over n. When you sum over n, you realize that N appears only on the phases. So you have the sum of phases. And the only possibility to be non-zero is that the phase becomes equal to 0 to pi over there. And the only possibility is here is equal to 0. So you have l minus n should be equal to minus, sorry, you find j equal k because we are summing over n. So you have this condition, j equal k. So when you sum over j, actually, you just pick the value k. And you have just one contribution there. I'm using this. I'm using this. Sum j goes from 1 to n of e to the 2 pi ij k over capital N is equal to n delta k 0 for k equal 0 n minus 1. So in this way, we obtain the values of c tilde. No, sorry, no, c tilde, we had the values of lambda k. So we know that lambda k is just given by this expression, j equal k. So what we found is that lambda is the eigenvalue c. And so in this equation, we have this part here, which was the eigenvalue. So this part, for epsilon n squared over omega squared should be equal to this one, 2 times 1 minus cosine of 2 pi n over capital N, which we want is equal to 4 times sine squared of pi n over. OK, so this gives us the eigenvalues. We also have the eigenvectors. I guess the eigenvectors, which were this one, vk equal vk. Yes? OK, here you have. You see, we were looking for the eigenvalues. So this is the eigenvalue. And then you have to put the eigenvalue equal to c tilde of k of this special. Yeah, OK, well, it's very easy. Anyway, so we have 4 epsilon squared over omega squared is equal to twice 1 minus cosine of 2 pi n over capital N. And this is equal to, this is just a trigonometric identity, is equal to 4 sine squared of pi n over capital N. OK, so we have this. And we also know the eigenvalues of c, this is the eigenvectors of c, which are this one. These are the phases, these phases. So we also know that yn should be proportional to where I write this. OK, I know that this is important, maybe. I should erase something. I erase this one, this part. Can I erase this? So we have the eigenvectors, yn should be proportional to 2e to the 2 pi n ynj over capital N. So we have yn, we have the dispersion relation. Let's try this, please, the dispersion relation here. So we have epsilon n, epsilon n, which is positive, by construction, should be equal to omega times the absolute value of sine of pi n over capital N. Maybe now we understand why I chose the normalization 1 over 8 times omega squared, because just to simplify this for that reason. So this is our epsilon, and we know yn. But now, from this equation, we can get qn, because we need both, or from the other equation. No, from this equation, it's easier. So we have the qn, OK, let's put here some constant. This will be some constant, which could depend on N. That's true, depend on N. So we apply this dispersion there. And we find that the qn is equal to i m epsilon n times this. k is constant, kn is 2 pi i n j over capital N. We have this arbitrary constant, which is just because we have to impose the normalization. We didn't do it yet. So the normalization was the condition there. So we have that the, are you guys correct? Yes, we have that. There is written that this is the imaginary part. OK, let's write all this written there. 1 is equal to i, which multiplies qn star. So you have minus i m epsilon n k, this constant of star e to the 2 pi i n j over capital N. You have this, this is j, the component j of this. So you have to sum this over j times yn, which was this one. So you have kn squared e to the 2 pi i n j over N. So there is a minus here, thanks. Otherwise, it wasn't simplify. Then you have the other term, which is minus yn star. So we have this kn star e to the minus 2 pi i n j over capital N times qn, which is this one. So there is an n i here. This again, this simplifies the minus 2 pi i n j over capital N. Then you have m epsilon n and everything, I guess, hopefully. So this is equal to the sum over j gives n, that's right. Yes, so the sum over j gives n, because there is nothing depends on j in this expression. So you find i times minus i is equal to 1. The same for this, it stands cancel. And so you find twice m epsilon k, km squared. Maybe check, OK. Factors can be, maybe there is some time, but I guess it's correct. So this is our normalization. And this fixes this, km up to the phase, but phase is completely irrelevant, this problem. So we can choose this km real, no problem. So we have everything. I guess now we have really everything. So we can rewrite this operator a dot k. But there is a subtlety. These are our energies, the alien values of c, which are actually the expression energies, as we see, because they relate to the commutator between h and a. But now there is a zero eigenvalue here, because for n equals zero, this is equal to zero. While this normalization condition here seems to states that the one should be equal to zero. So this means that we cannot impose this condition for the zero mode here for n equal to zero. So we can impose the i, well, this was our convention to choose this normalization for it was for any n, but zero. So for zero, we have to treat it separately. OK, so what can I raise here? This again now. This again. Indeed, OK, we assume from the beginning that I'm trying most different conditions. Why did we do that? Why? So normalization is this, but we don't need this anymore. So let us rewrite this a dot k. So the a dot k is finally given by, I use now this pressure so that I avoid typos. So we equal to sum over j from 1 to capital N of e to the 2 pi i n of kj over capital N divided by square root of 2m omega sine of pi k over capital N times capital N. And here you have the momentum pj plus the same 2 pi i kj over capital N xxj divided by nothing. Raise here times the square root of raise n i square root of m omega sine of pi n over capital N divided by the square root of 2 capital M xj. x, yes, j, whether it's a k, yes, or n. OK, I think this is our final result for the a dot k. And we know we impose that a k a dot k is equal to 1 as in the single harmonics effect. And we have k different from 0. k different from 0. When we have k equal to 0, so this is k different from 0, let's now think a bit about the case k equal to 0. k equal to 0, everything was fine, but the normalization. And indeed what you find is that the k equal to 0, the solution was something just proportional to the total momentum of the particles. And this is clear because it's a pre-ordered system and the potential depends on the difference of the position. So this means that the Hamiltonian is invariant under rotation. Rotation, OK, translation, global translation. And so indeed k equal to 0 correspond to, what is it? k equal to 0, OK? We can choose instead of, it's just something proportional to the total momentum, which is equal sum over j from 1 to n of the particle, vj. So what I mean is that if you consider the commutator k, here we derive this asking for h a dot k should be equal to epsilon k, which is equal to omega sine of pi k over capital N times a dot k. Now we have that the momentum satisfy h capital P equal to 0. This is the difference. This concept for the moment, nothing more than that. OK, so we have all these operators. How many of them? How many operators we have? We have n minus 1 a dug, right? Then we have n capital N minus 1 a. And so the total is 2 capital N minus 2. And we have a momentum, total momentum, p. And operator is missing here because we need two capital N operators, like the original variables where capital N x is and capital N p is. So which is this variable missing, this operator missing, is the conjugate variable of the total momentum, which is the central mass position of the particle. So the operator that we are missing is, we can call, we can call x, which is somewhere j from 1 to capital N of the position divided by capital N. You can check that the commutator between this and this is i. So these are conjugate variables. And you can also check that this commutes with all the a. a, c, as well as p. So now we complete, I think we have all the operators. So we pass from the x and p to the new operator, this lateral operator, a dug and a. We have this subtlety because we lack an operator, which is the total momentum because of the symmetry of the Hamiltonian, total momentum, and the conjugate position, central mass position. So what do we do now? Well, we write the Hamiltonian in terms of this new operator. So we have to invert this relation. You can invert the relation, but I just write the result. It's not very useful to do really the calculation. It's easy. And what you find is the following. You find that the momentum j in the momentum of the particle j of the eigenj is equal to some from n because from 1 to capital N minus 1 of e to the minus 2 pi i. OK, let's call this k. 2 pi k over capital N square root of m omega sine of pi k over capital N divided by 2 capital N. And here you have a k plus a k, no, no, a k, a n minus k, plus everything, so all this, plus b total moment divided by n for the xj. You find some k from 1 to capital N minus 1 e to the minus 2 pi i k n over capital N.  These are the inverse of those relations. And again, I already wrote them again because it should be clear. So the algebra of the operator a k a dagger q is equal to delta kq a k aq is equal to 0. Yes? Because again, we have to exclude the case k equal 0, which is like a k equal N, capital N, because it's always in the phase. It's 2 pi k. So it's a matter of convention. I could have written this as, in this way, I have to remove the case k equal 0, so you have n minus 1. It's original. We have this. Yeah, yeah, 1 and it is. So if we start from, we have to remove it at 0 capital N. You're checking this. It's completely equivalent. So we have a question, because there is no L in any other place. I don't know why I wrote L, because here is written L. So here, OK, so let's do it in this way. L. So there shouldn't be j. Indeed, there is no j there. That's a typo. OK, so we have this ration, but then we have also that xp is equal to i. Then we have all the other, which is x a dagger k is equal to pa p a dagger k, which is equal to 0. So in other words, every commutator is equal to 0, but the commutator between capital X and capital P and the commutator between a k and a dagger k. These are our operators. And let's rewrite the Hamiltonian I'll do for you. So you can check. And you should, because I hope it's correct, but no. So the Hamiltonian is written in this form. Total momentum squared divided 2m capital N. This shouldn't be surprising, because it's the kinetic energy of the central mass of the particles. So this should be something that you should expect. Then there is plus sum over k goes from 1 to capital N minus 1 of omega psi k over capital N a dagger k a k. Plus, there is a constant, if you use this for a real important constant, cotangent of pi over 2n 2n. What is this? Oh, this is part of the other one. So this is something you should expect. This is the same as in the harmonic oscillator. Now, but now we have more modes than the other case. So we have a slightly more complicated system. And there is a constant, like 1 alpha omega in the single harmonic oscillator here. We have 1 alpha omega cotangent of pi over 2 capital N. You have to leave it there. No, this is just the original variables. Excel was the displacement of the ions from the left side. And P are the conjugate moment of the velocity of the particles, the moment of the ions. What's the position of one phonon? Because it's a collective, OK. You already called the original phonon. I didn't say anything about phonon. OK. Anyway, OK, let me tell everybody this. So first of all, we should understand this Hamiltonian. So we found this Hamiltonian. And it has the same form as in the single harmonic oscillator. But now we have the sum of all the modes, which are independent because they commute between one another. So really, we were able to reduce the Hamiltonian to independent oscillators. And it was coupled for each other. So this is what we did. And so what is the ground state of this Hamiltonian now? We know, no? The ground state is the state such that it's annihilated by all this a. So it's the vacuum for all these a's. And it has also another condition. We should have zero momentum, zero total momentum, because otherwise we have a positive contribution from here. So the ground state of the model, which I write the ground state, is such that it can be written as the vacuum of all the a's. And then we have, let's write, zero. Well, we're going to put zero, OK. Vacuum, come on, zero. Well, this is momentum zero, the eigenvalue of the total momentum. This is our ground state. I give you four minutes, because some of you ask me, really strict four minutes. Then I start again. So don't go. Here in problem for the Hamiltonian, we have a sum. Yes. It's from k people who want and minus 1. Yes. We have omega side, but the second term? No, this is just a constant. This is a constant. So it's outside the sum. Oh, OK. And because of that, what is this omega cot in here? Cot engine, yes, of pi over 2 capital N. And what is the symbol that is besides the t? 2. No. Oh, it's a g, a cot. OK. This is cot engine. Cot. It was cot engine, yes. Pi over 2 capital N. Sorry? How did you get this cot engine? Well, what you obtain is the sum of this, and you can solve this. Just a serious sum, you can re-sum it and you obtain cot engine. If you want, you can write it as a sum, so yeah. Because you are using it. Then it's already, can you get? No, there is a reference for this case. What is it? Reference. Reference for you. I don't know. Now I don't know where you can find this exactly. I know what you're looking for. There are lechernos, OK? Maybe I will give you. But without doubt, you can find references for the singular monocledo. I should check which book treated the capital monocledo in this way. Because generally, OK, these problems are considered for this matter. And they are solved in maybe a slightly different way. So you just write the wave function and you try to solve the equation like we are doing. So I should think about the book, for instance. I don't know now. Sir, I didn't understand. I had this problem, too, of monocledo. And I found that it is unsolved. I thought about it. I got a note from my advisor that all these things are published. So you discovered today that they can be solved? No. No. Thank you. Use it. Use it. Use it. OK, so we will start again. I guess I see more than time. OK. So shall we start? When you say vacuum, it's the vacuum of the particles that we define. So we have another degree of freedom. So it's not, from my point of view, it's not so surprising. What's the physical meaning? So you know for particles having moment of freedom, why don't you think it means first of all for the vacuum, we can have p equals to 0 with the vacuum. But this means simply that it's localized. The central mass is completely localized. And you have p equals 0. Let's see. There shouldn't be problems. I hope. I think the center of mass is moving with some less So if we can move to some other place, I will turn on the momentum. Let's talk a little bit. If there is something here, like I said sitting down. What I mean is that these are completely independent terms. They commute. So you can create this part just like a standard particle without a potential, so a free particle. It's just a return of a free particle. And so just free because it's a p squared over 2m. So free particles at the ground state is that the momentum is 0, but it's completely localized. It's not an unnormalizable solution. OK, so let's start again. This is our ground state, which is written as the vacuum of this lateral operator a k. And it has 0 total momentum. OK. Now, again, how do we construct this set of states? We apply this operator, the creation operator. We understand why I call it a creation operator. And so we have a generic set of states can be written as in this form n1nj. Let's consider just a set of states with a 0 total momentum of the single simplicity. So this will be even by trust me about the normalization because it's something that you could guess easily from the result from the harmonic oscillator, single harmonic oscillator. So you have this a dagger 1. No, what is this? Yes, 1 to be n1 a dagger. This is 1 is k1, 1, k1, yes, n1. OK. No, OK. Sorry, sorry, sorry. Let's write it inside the form n capital n minus 1. So we have a1n1, a capital n minus 1 to be n capital n minus 1. 1, yes, n minus 1 factorial, vacuum, 0. This is a sector of our space. It's a sector just because we chose capital P, the total momentum to be 0. Otherwise, we have other eigenstates of the problem but just by changing the total momentum, increasing the total momentum. Just focus on this 0 momentum sector with this. How is this called this? OK, now, so far this formalism was just useful for some of the problem. So we define this kind of creation operator. And we were able to diagonalize the Newtonian, as we know that we also know the energy, clearly. Because the energy of this, the energy of the state, I will call it n1, n capital n minus 1, is just given by the sum over the sum. Now, let's write it well. So we have the sum of n from j equals to 1 from n minus 1. And j epsilon, the energy of k, which is the energy associated with this, which is already the energy, is omega sine of j pi over capital N. And I guess that's z i is this the energy. This here, yeah. Maybe that's right. OK, because it's consistent with the previous equation. I think that's it. OK. Yeah? Make it? 0, yeah? Why do you speak to the state? This is just another quantum number. It's the quantum number corresponding to the total momentum. And we are in the sector with 0 total momentum. You have also, again, you have a state with different p. Yeah? So now, we have created one vacuum, n1, 1, 2, n, n minus 1, so all of this is one more particular state. This is not a particle. This is 0. This is the momentum. It corresponds to the total momentum. It's a different, I would put a sprite in this way, just to. I see. Why is it that it's pointing the vacuum after we have created the particle? Yeah, but OK. If you want to characterize the eigenstates, you have to consider all the quantum numbers. So we have these quantum numbers, which are the number of particles with a given momentum. And then you have the total momentum, which is equal to 0 in this case. Yeah? The total momentum is 0. The chain, OK, it was kind of ring so that all the ions are just rotating. So you can always find the reference system where momentum is 0. But the sort of problem you have like all the oscillators for were coupled, and then we are. We decoupled the oscillators. Yeah. I can't find the explanation for that. The explanation is that, OK, originally when you consider the harmonic oscillator, you are describing the oscillation between two ions, just two ions. But then you realize that this is not a normal mode. This is not a, this doesn't have a fixed energy. This kind of oscillation is the system. Instead, there are other oscillations that have a fixed excitation energy and are collective excitation, where all these ions are moving either together or in the opposite phase or whatever. And this describes this kind of excitation. Yeah, yeah. OK, so now that is a nice interpretation of this formula. And the idea is to, indeed, reinterpret this operator here, this lateral operator, as a way to create particles, create a particle. So the idea is to say, OK, when I apply this a-dug, so this is, indeed, this I call the vacuum, so absence of particles. And then I'm saying, now, when I apply this a-dug, OK, I'm creating this particle with a given momentum, k. Just an interpretation. And using this interpretation, you realize that here, the state of the system do not have a fixed number of particles. Because here, you can construct, OK, we have the vacuum, zero particles. Then if you just apply one a-dug, you find one particle. So our system, generally, in quantum mechanics, you say, OK, I have a fixed number of particles. You've got the Hamiltonian, and that's it. So this is your states I've given, fixed number of particles. Now, if you use this interpretation here, we have to change, in a sense, our space. Because now, we have to take into account that you can have an arbitrary number of particles. In this space, it's called the Fox Space, OK? When you have this situation. So in other words, we interpret this operator as, operator that creates this kind of particle. So in particular, for example, the state, one and all zero here correspond to having just one of this particle with a given momentum, k1. And which kind of particles are these? Because we know two different species of particles. We know that there can be bosons. There can be fermions in general. So what are we constructing here? You can easily verify that we are constructing bosons. Why? Because of this algebra. So we have this commutator commute with one another. So if you interchange two particles here, you find the same wave punch. The same space, one equal to one. So these particles are bosons. And this is why sometimes you could hear that the way to diagonalize the harmonics later is to map it to a free chain of bosons. These are just bosons, free bosons. And we have a name for these particular bosons in this harmonic chain. They're called phonons. And maybe you already know about phonons from other curses, maybe you derive it in a different way. And they are exactly this model of oscillations. So the concept of particle is different from what you imagine usually. So it's not something that has a given position that you imagine of this moving, a particle. Here it can be also a collective motion. It's an effective description. So a single boson is something which includes all the degrees of freedom of our system. But still we can call the boson and we can study its properties. OK. So that's nice. But yeah, we like to diagonalize a metronome. But we would like also to investigate at least some properties of the state. We did all this work, at least the way we could compute something of the ground state. And yeah. They are all the same. Yes, indeed. Indeed, all the operator a tag commutes with one another because of this. So it's completely similar. And what is nice of this interpretation, because of this formalism, is that when you include, you consider bosons in identical particles in quantum mechanics, you have to symmetrize the wave function. So it's something kind of complicated, complicated map. Here instead, you obtain vectors which are already symmetrized. You don't have to do anything. You already obtain the final result. The symbol is already inside the properties, inside the operator. Now that we obtain the spectrum, we obtain the ground state, it could be nice to see some properties of this harmonic chain, just to do some physics at some point. And yeah. Well, you see from here. In this particular case, there are degeneracies. Because if you plot a sign of this as a function of k, this is nk pi over capital N. And this is the energy. What you find is this one. There is the degeneracy here. Yes. Yes. In general, you don't do that. Now as a matter of fact, every time that you consider chains, you have this kind of degeneracy. You have a similar degeneracy. It's always present. No. OK. We restricted ourselves to this sector. But you should imagine that you can actually consider. You can put every moment in p. So you will ask, OK, I'm interested in the ground state with a given moment, different from 0. Not the real ground state, but you choose another sector. And then you just change p. And everything is the same. So p is just a phase. When you write in real space the eigen function, the fact that you choose a different p means that you have a phase in front of everything which is proportional to the capital X. I, you choose some p, some particular p.  So the only difference between this and this with a p is that in the real, in coordinate space, you have this kind of phase multiply. It's completely the same. What you should expect is, because the interaction depended only on the difference of the position. It's not this momentum. It's a different kind of momentum. It's not the momentum of the ions here. It's the momentum of this effective particle, which has a completely different meaning. It must be clear about this. So we started with this variable. All the phonons, which are other particles, we correspond to this oscillation. So it has a different meaning. It's not a motion of the ions. It's something more complicated. OK. But now it's time to do this kind of simple calculation. And in particular, we could be curious, for example, to see in the ground state of this model, where are the ions? For example, so what is the average displacement of the ions with respect to the lattice? And in particular, clearly, if we compute the average displacement we find 0 because of symmetry, all the problem. So if you want to see the absolute value of displacement, we compute the squared of the difference of the x. We want to have some knowledge about how far the ions are from this artificial lattice sites. So in particular, we compute, OK, this can be useful. This we know by heart. I don't know if this is a boundary condition. No, no, we did. We did when we computed this. And when we computed the eigenfunctions and the eigenvalues of C. Because if you considered the matrix C as those particular eigenfunctions e to the phases, only if you have periodic boundary conditions. As I was telling to your colleague, if you consider open boundary condition, for example, just j, you have sine instead of the phases. As a matter of fact, you have a very similar result that you still can write in this way. The only thing that changes the argument when you change the boundary conditions. The reason why is this the case. Because if you imagine to take the thermodynamic limit here. OK, we will do. But now I just very quickly I tell you this. Then you send n to infinity to have infinite oscillator. And then this gives you the dispersion relation of this particle. But now if you are taking the thermodynamic limit, the boundary condition don't play any role in the bulk. So this is why you should expect the functional form here should remain the same. At the most, you should imagine that some change in the quantization of the moment already in there. The moment of the system, whether the state number n is fixed, that's why we don't consider this last index. OK, the last index. OK, the last index, because we have defined this operator only for index k different from 0, or capital n. So they are completely undefined. It's not something I remove. They are not defined. And the remaining operator, there was two operators remaining, corresponding to this 0, which are this one. So I just change the notation. This I call a. And this becomes x and b. And the reason is that a, you see they are not their mission. You have a and a dot. Instead, b is their mission. So this is why I change the completely undefined. And also because we know the total moment, we use b to indicate the total moment, which is an x to indicate the position. OK, so the idea is to compute this displacement, which is, let's use the notation. So from now on, I assume the total moment equal to 0. So I'm not writing 0. I'm always assuming total moment equal to 0. So the first question is to compute this displacement. What is the expectation value of this? Because x was the displacement of xi squared. So first of all, well, our system is invariant under cyclic permutation of the ions. So this means that this is independent of i. So we already know that it should be equal to x1, for example, and fix the particular side. Then how do we compute this? This is now when this kind of formalism becomes very, very useful. Because now we can express x in terms of the A operators. And we know what happens when you apply this A to operators to the vacuum. So we just have to write this expression and then use this computational relation and be able to obtain the result. So let's do it. We are here vacuum. Now we have to write this x1 squared. That's why I pulled this. OK. So we have, I want to understand, because m is i a n minus a minus a dot k. Then we have plus or plus x. And we have the same here, OK? This is what we want to compute. Now, OK, we have several terms here. Let's immediately see which terms go to 0, either go to 0, the last term, x1, 0, 1. So here we have, OK? Anyway, first of all, we are sometimes like this, OK, multiply by itself. And this we have to compute. Then we have a term, which is this, multiplied by x, here. But now what happens is that this commutes with x, because the two operator commutes with x. So this means that you can move this operator to the right, if you want, of x or not. Now, when you move this operator a to the right, then it annihilates the vacuum. So it is equal to 0. On the other end, this operator is an a dot, and annihilates this one. So you have that there is zero contribution from this times x, OK? Then we have, I should see, now, it should simplify in some way, the contribution from x, for x squared here, OK? So let's compute it, because I did it, and I didn't have that. Let's compute this first term, so this first times the second. And we already know that we can neglect this, because this annihilates the vacuum. And in the same way, we can remove this operator from here, because it annihilates the vacuum on the other side. So we have that is equal to, this is equal to 2, OK? The other is the vacuum. Then we have some k from 1 to n minus 1 e to the minus 2. Let's consider first this term times this, so 8 pi k over capital N, 1 over square root of 2m n omega sine k pi over capital N times i a n minus k. Then we have here sum over, I call this q, 1n minus 1 e to the minus 2 pi i q over capital N, 1 over square root of 2 omega sine of q pi over capital N times i minus i a dot q. Right to the vacuum, and then we have also the other term. OK, so now it's true that this doesn't annihilate the vacuum here, but if we are able to move this operator here, then we annihilate the vacuum. So it becomes 0. So the only possibility for this term to be non-zero is if this n minus k is equal to q, because only when k equal to q, the commutator is different from 0, OK? So this means that this is equal to pi. Now we have the condition q equal n minus k here. So we have a sum of k from 1 to capital N minus 1. And then we have e to the minus 2 pi i k over capital N, 1 over square root 2m n omega sine of k pi over capital N. Then we have this term with the q equal capital N minus q, which simplifies this term. And we have this term when, what is this, pi? When q is equal to capital N minus q, which is equal to itself, because the sine is in variant under reflection about pi over 2 sine. So this is the same term. It means that we can remove the square root here. And then we remain with this a n minus k, a dot n minus k vacuum. Yes? Yes. We know that the vacuum is defined as a state such that when you remove, there are no bosons, that's 0. It's equal to 0. OK, so now you consider all the terms here. You immediately see that this term here gives zero contribution. Why? Because you can apply it to the left. And so this annihilates that part. Analogously, if you consider the other term, now you have in this other term, you have this contribution a that annihilates this vacuum. So you can remove those immediately. Then, OK, you remain with these terms. And now you realize, oh, I should be careful, because now I could move this to the right and annihilate the vacuum. And the only possibility not to do that is that n minus k is equal to q. So this means that I can just consider that term in the last expression. And this is what I obtain. Now, if I move this operator to the right, what do I find? 1, sorry, I find 1, because the commutator is equal to 1. And then the remaining term is just the a applied to the vacuum. What I mean is that this is, OK, I cannot write here. Maybe I'm sorry. I can write here. So this is equal to the commutator between a n minus k a dagger n minus k plus a dagger n minus k a n minus k, just by definition of the commutator. This term is equal to 1. And this term is zero contribution, because it's applied to the vacuum, OK? So in the end, you find that this is equal to 1. And we have an expression plus the rest. What about x squared? We will come back this afternoon. We will continue. And yeah, I think it's enough. Yeah, yeah, we will talk about this. OK.


I'm invited to this conference which is called Ruby Midwest. I am Australian so I now live in San Francisco so I looked at the map and thought, this is going to be awesome. Yes! Yes, I'm coming. Ruby Midwest. Of course. That's just up the road. That would be sweet. I'm sick of tired of travelling from country to country and I got that wrong so I thought okay, so how do I do this Midwest business? This is the middle of the West. I was pretty lost by now. In my agile fashion of what's next I looked briefly at the invite and I said I was in Kansas. That was Kansas City in Missouri. Sorry. It's taken me a while to get here. So at some point I had to ask the question how this possibly is called the Midwest. So for me it's been an actual safari. You're already thinking there can't possibly be more men's in this. Oh yes there can. That's how. Conference and it's now 2011 so unlike a lot of us when we first went Ruby we all came to the first RailsConf and it was like who's making money from Ruby and Rails and there's very few people but now we all do and as projects they have money, we have to make decisions, we have to spend that money. You might never think of it like that but trust me your boss does and your boss is thinking in this fashion he's thinking I could spend the money on features or I could spend it on the other aspect of the performance aspects. You want to add resources. You want to get more performance. You want your app to hum. You can press in app cloud the add button which is a tremendous button and when you do that it costs you money. My manager's not too thrilled to make that very distinct association.  Just in case you're wondering. Nonetheless so you've probably wondered well this is how I think. There's still a university student in me that wants free beer and certainly free internet and free performance so I was always very interested to have it here through as much little money as possible I could get good performance. This is kind of in the back of my mind constantly and so I work in engineer now and a lot of people have been doing the event machine, doing other things and performance and threading or whatever so I was getting a little bit sick and tired of all these random conversations on Twitter that are interesting to follow that's sort of hard to get to the guts of. So what I did was I organised a very last minute EM RubyConf which could have been called concurrencyconf and it was sort of the back end of Braille's Conf and it was really good. We flew some people in. We had some people do some videos, prepared videos that they gave us and I think they had a packed room of 50 or something people. So I've learned all these things and I went and read some research papers. There's a way to spend some quality time. And I thought it's unfair if I do all this and I don't tell you about it and I thought well I could do this one in two ways. I can tell it in such a way that I come out very clever or I can do it in such a way that I come out very funny and no more importantly or I could give you just the answer. Like you're here writing Ruby, it's great. What's the one thing I could do? What's the 50 things you could do under 50 different edge case circumstances? What's the one thing you could do? And so I want to give you the one thing. So we talked about angry resources and whilst that's a thing you could do, let's see what else we can do. And so the goal for me, I just want to write code. I don't want to be thinking. Like I love James's talk because you just have one pattern for things. I try to have APIs that don't ship nils, wrap up things that might ship nils such that they never ship nils and you never have to think about it. You're just trying to lower the cost of thinking and all I want to think about is my application. So I'm going to give you a solution, a plan. How to think about this stuff. Should I use a vented? Should I use threads? And how's my code fit in that? And here it is! And if you forget to write this down, I will show it about a half a dozen times more. Keep an eye out for it. Now you think, well that's great. What does that mean? Well here is the thing you should do next example. Like this is the money shot. I think that's rude actually. There's a better way of saying that. This is what you pay money for. You know, it's great. You pay some money to come to this conference. Personally I think this is worth. If you have not done doing this, I mean think about how much money you spend running web apps specifically. A lot of people want to talk about it as web app focus because you get an interesting side effect when it comes to threaded. But you're probably spending lots of money. You do this, you spend less money, you're paid for the conference, and everyone else is free. Not that they weren't valuable. That's been really, really good. I've actually thoroughly enjoyed this conference. Alright, so what is a vented? A vented is where you arrange IO. Now I would like to say orchestrate IO. But there's a cost to that. And these guys have to have a smaller font. And I'd rather have a bigger font than spend 30 seconds explaining it. I want to, threads is where you're going to do actual work. It has an interesting premise. What that means is in a vented you can't do work. So, if you're building any vented apps whether in Ruby or that other thing that's very popular, you can't do work. And we'll talk about why. And what you want to do is write code. So here is the solution, just in case you forgot to write the notes down. Here is the bits and pieces you're going to use for your app. And you're going to write code at the bottom. So you want to use resources better. Let's talk about concurrency. This is how we're going to get all these resource utilization. Now you might think, why would I, why do I get an engineer? I sell memory for a living. I mean, CPU, memory. That's the charge for it. It's good. Good business. You should do it. And specifically with me, not in competition, that we don't have fun at all. So let's see how we can use our resources better. Let's compare the two that are sort of similar. And certainly in Ruby space, we've all gone down the top one and we've not investigated, spent a lot of time convincing ourselves about the second one. So let's talk about process concurrency. If you want to have one requested at a time, that's going to take one process and it rails that much in between 50 and 150 meg. Memory is cheap until you have a need to scale up. Actually, I was really good to the other day that sort of choked around this. What was it? Memory is cheap until you double it every week. That's it. Sorry, 100 requests. Yeah. What do you think out loud? All right. How do we, concurrency is orchestrated by the kernel, a couple of example, abstracts, unicorn, passenger, a mongrel cluster is an example of how you get concurrency there. A thread of concurrency, which you might never have done. You get 100 requests as one thread. Now, how much overhead there is a thread? I just need a number. You might say, well, it's probably 250k, but you just don't get a lot of reuses. It's a number that's substantially smaller in the reality. So 100 requests is still just the cost of one process. That's pretty cool. What that means is that you're bound not by memory anymore, really. You understand this? You're bound by something else, like CPU. So now you get to grow a lot and use your CPUs a lot better. All right. We'll come back to mongrel. So summary. One request is cheap. Take notes. I'm just going to follow the logic. Very simple logic. Just a lot of hand gestures. And here is a very dodgy image that I took from Google Images. When you search for winner, I guess I can't remember now, but it looks really cheap and nasty. I thought I'll do it. So that's why threads. That's why threads in serif process, because you get the code reuse and all that sort of stuff is now not duplicating in memory footprint. You get to be bound by something else. Now, educational lesson. Anyone speak sign language? What's that stand for? WTF. WTF. But in code. It's not rude. What's interesting about this is that if you're going to swear, you need a friend. That's got three fingers. I've got two fingers. I don't know how deaf people can do what they do with only two hands. Anyway. So, we talked about mentioned mongrel. And who still runs an app under mongrel? One. Okay. So two. So it's not worthy why I didn't mention it. Let alone. Talk about concurrency. But I have something interesting to show you. Code. There. Proof. So anyway. So anyway. If you don't use it, what's the point? We'll come back to it. Here is Dr. Nick's guide to is something thread concurrent potential? Business. Okay. So it is a better name. And the premise is, if everything's thread safe or has threading enabled, I just have a graph and a lot of others that I took from somewhere, and it says thread safe, you get the gist. Has threading available. But in 2006 when Rails came out, it was not thread safe because it just wasn't important. Like what's the point? Because Ruby is not thread safe. Or it doesn't have threads. So let's explore what happened over the last five years. In 2008, Rails 2.2 came out and it was the first thread safe Rails ever. Hooray! No one used it for that. Which is a bit sad. And we'll talk about how you use it for. Ever since 2008, is you add this somewhere. Anyproduction.rb in your environment.  Booyah! Budget time. You know, just ask for a raise. Look how much money I saved. Now if you're in Sinatra and you're going to need to write this down, you need to add this line somewhere. The hash. Very important. The error message. Not very relevant. So again, close. Rails and thread safe. Sinatra, over all, we're good. So let's look at Ruby's. 186 wasn't, 187 wasn't. 192 came out last year. It's got 19 friends. Woohoo! Yeah! I don't need to have this talk. Problem is, a sad face can be run Ruby once at a time. Which is an interesting interpretation of native threads. And the special mechanism that they achieved this tremendous feature is called the gill. And it has a sad face. It's part of its... And I like to call it the grumpy gill. So sadly, even in 2010, and as of 2011 with 193, it just came out, it's exactly the same. Just not worth another slide. So here we are. Threaded, thread safe, but no threads. Sad face. So you might think, well, what's the point? Okay, we had this conversation. Do we move on to invented now? Is this why everyone's excited about invented? No. People are excited about invented for other reasons. So threads. We have them. In fact, Mac Ruby also has gillers and has threads. So how many people run Mac Ruby in production? I don't... But these two. So how do you get J Ruby? That's pretty simple. And in fact, as of Rails 3.1, if you're in J Ruby at the time you run Rails in my app, it will come ready to run in J Ruby for the first time. And what that means is that your gem file has this sort of thing in it. So they're the sort of bare basics that you need. And if you pick a different database adapter, it'll change to be appropriate. So that's very cool. Most super cool, as you can probably guess, my enthusiasm by now, is that we're all green. And I think maths of concurrency say that we can use 3 concurrency, which gives us this, which means you save money and you get the pay raise that I was suggesting. And if you don't get the pay raise, you just come to me and we'll figure something out. I have no idea what that skin's going to look like. It's going to be dodgy. So how do I use J Ruby in Rails? I think called Trinidad. This is what we use in production. And the reason we use it in production is because it's really good in development mode, because it has a little command line out and pretty much it looks like every other. Because J Ruby isn't about Java. It's about a Ruby implementation, which, and this is just a secret. If you use J Ruby, and you might not care, it's a feature. You can use it. You can not use it. It's just an option. If you want, you can use some Java code. Now, I don't want to make you. But it's purely an option. By default, it's disabled. So J Ruby is about running Ruby. Hence, four of the five letters in the name are the word Ruby. An example app. That's just the one we put up an app card to run. And it has J Ruby sort of enabled. So if you're running J Ruby, that works. By default, so if you run in development mode, for example, if you have the thread-safe thing coming out, it uses essentially when it pulls it to when it's basically a wrap-around Tomcat. Tomcat has five J Ruby runtimes. That's your process concurrency. Put on thread-safe mode. Booyah! One J Ruby and threads. And that was it. Hard days done. Time for the bug. No, we're not here because you'd, you know, it's all shut. In Kansas City, if you wanted a coffee, for example, you have to go to Monday. So we get that. So it's all just normal app code you're writing. You know, none of that's the mysteriousness of threading and thread safety because it's a web app. So let's talk about that. You're saying I'm scared of threads. Okay, you're not going to say that out loud. You're going to say something silly like I don't like Java. Whatever. But see, web apps are sort of implicitly thread safe. And so what I've written for you is a mixed-dweb concurrency. A very picturesque vulgarity of our concurrency. But the summary is you store states somewhere else unless it's safe. And that's pretty much that. If you do that, then you're thread safe. And web apps you do. You don't leave data lying around for the next request to come through. Stateless. You put in no database. You're done already. No reason for that. Another hard day's work. Come on through the pub. You're thinking, so the next question you might ask, well, what about all my libraries? Good question. So you're going to Rails plugins and click on the little thread safety button. There are libraries that declare themselves thread safe. Easy peasy. That was fun. Let's move on. All right. So with that, you're going to use Trinidad and... But in the back of your mind, you've opted to come to this session. You can do something else, I don't know. And you've got to hear about Event Machine. Event is a cool thread or not. And I haven't even heard of that thing once. Let's talk about this. So what is Evented? Evented is basically it's a loop. You've heard of loops. And it loops over things that might be... might have some IOs. It says, do you have any IO? And if you do, it does something with it. That's the point. And I remember... And I decided for the sake of brevity to rip out every other slide about Evented. That's just not that relevant. I mean, the point of this talk is that if you're asking the question, Evented versus Threaded, I answered it. And I'm not going to justify why. You have work to do. You wrote a web app. So let's talk about one of the real cases in a web app where you're going to be doing sort of IO bound things. The request comes in and might be like a page cache or some sort of contact cache files, etc. You ask the question, if it's a miss, go to the web app. If it hits, well, let's move this to make this IO work. Okay? So it's outside our app. You may have seen this pattern before. I didn't make it up. I just put it on a pretty slide. This is Evented work. Our real work is inside our threads. And we're going to do this with a thing called EngineX. It's pretty cool. Who uses EngineX? Who knows how to configure it? That's the implicit part. You know, if you're going to use it, it's great and it's great for many reasons. There's a graph of goodness. The show is known as less memory users. As you get closer to currency. Sorry, that was a request per second. This one is a supply line memory, which is one of the great benefits of Evented Things. But when you start to think Evented versus Threaded, you're talking about optimization questions. And I challenge you that most aren't going to be solved with Evented. They're going to be solved with threads. And if you do have some other stuff, pull it out in the front, or pull it out in the separate parts. So, because I need to give you one point. Who doesn't have so much time? And I'd rather tell funny jokes. So, you put Evented stuff in the front, threads, and then you're out. You want to get this, obviously, amongst other places. Us, if you want a job, we can come work with awesomeness. And me. To greatly distinct groups. You should. And to the goal, as always. I want you to be happy. Because I assume you're a lot like me. And you start with happiness. There's a sad world. People occupying things. If I could be in suicide without leaving a note, I'm just going to stand over here. Why? You wouldn't understand. The first time I got to tell someone else a joke. That's worth it. There's an Irish comedian, Ed Byrne, and he has this bit about...  Something that only a man would say, like, yes, that's right. Women should be locked up in the kitchen. They should be brought out like that. And then she... You know, all of a sudden, changes. But you don't know why. Because she's looking at you differently. The vibe is different. And you say to her, what's wrong? What happened? What's going on? And she says, and sing it with me, if you don't know what you've done, there's no point in me telling you. What's so logic as that? And there's a lot like saying, if you're hungry, there's no point in me making any dinner. It's the same logic. So, yeah, so there's occupied people. I'm sure they're doing it all for the right reason. Where it happens to be. So, your code wraps up in threads. Your code is normal code doing normal things. You know, threads say fashion, which is implicit. Put any event yourself in the front, and there's some things I think you should use. This is what we put in production. We support it as an example of why I think. There are other options. And if I'd realized, like, if at the time, there's a thing we're building, well, sorry, there's a thing, a group of people are building, that's some of them, a group of media's team, called Puma, pronounced Puma, or however else you pronounce it. And I don't know in America. I'm not sure the right way is anymore. I love the queen. God bless the queen. And for what it is, essentially, it's a fork of mongrel. So mongrel, that threaded thing, mongrel hasn't been touched since mid-last year. But as a code base, it's a great place to start. So basically, they've pulled it out of the dustbin, given it a new name, coded paint, fixed it, changed the readme, and making it work as a multi-threaded app stack. Which we've never needed before, because we've never had a multi-threaded normal Ruby, than how we do with it. So they're building that. And I think they're going to put some other cool stuff in it, that sort of invented business. So this is it. So if you wondered what the point was, and it alluded to you because of my subtlety, this is the last slide. I have one more slide, because I felt that you deserved it. It's a long conference, and I felt you needed one more cow. Thank you very much. I'm taking a lot of room for questions. I don't want any. It's a thread thing. What would you like to talk about? I think it's awesome. We should use them more often. Does anyone remember? Sorry, go ahead. The standard comedy class took years back to help you with your presentation. So, yeah, not the topic. So I tried. It's hard to say how funny it is.  Like, everything you say may as well be funny, or you may as well not say it. And at the same time, your audience is looking at you going, ha-ha, make me laugh. You don't have those same high expectations. That's a lot easier. All right, you guys are chance. Thank you very much.