 Okay, thank you Sebastiano for the introduction and it's a pleasure to be here and Tell you about alps And I was going to give a bit of an outline which Sebastiano now pretty much preempted So as he said in the first lecture, I'll be introducing alps mostly giving an overview of the different components of the package Talk a little bit about the technologies that we use for this open source Software package and so on and then I'm going to spend a little bit of time at the end maybe half an hour or so Introducing some of the physics that will be studying using alps in the hands-on part of the of the lectures Which will take place in the second lecture, so you'll be running your own simulation Using the alps package and that will be happening over in the in the computer lab And I would like to encourage you to ask questions at any time during the talk I know there's probably many different backgrounds and I don't want to lose too many people So if anything that I say is unclear, please do do not hesitate to ask me So what is the goal of the alps project What is the alps project? so the goal is to provide open source community-based or community-backed tools for the simulation of strongly correlated systems and so the hope is to overcome the paradigm where everybody sits down and Individually writes the same programs over and over again, you know, everybody individually writes the same libraries writes the same codes and instead You know people can join together and write a lot of these Ingredients that go into many programs or even the complete programs together and that way have them be more reliably Be more reliable be better tested be more efficient and better documented than if you sit down and do all of this individually yourself and So basically we we try to achieve this in kind of four different components One is to define a set of standard file formats that can be used to exchange scientific data Then we provide libraries that implement many of the key Functionalities that you'll be using that you'll be needing to implement your own software packages So you want to write a Monte Carlo code? There's you know ways to to perform measurements and error analysis and so on Then there's evaluation and plotting tools mostly in the in the form of a Python library and finally we provide complete applications For for several popular algorithms in particular quantum Monte Carlo algorithms But also some tensor network algorithms such as the imagine I'll speak more about that and these are really ready-made applications that you can use To to run your own simulation and that's what we'll be also working with in the second lecture Who is doing this? So the Alps collaboration is is a global and very large collaboration of people In the most really most recent published release release 2.0 There were groups from Switzerland the United States Germany Japan Austria France and Poland involved And then I'll also be speaking a little bit about the recent matrix products data applications Which were mostly developed in Switzerland at ETH Zurich But then I was in the US during the development of that So it's really a very big group an international effort Which is centered around ETH to but involving a lot of other people developing the software package What are some of the key technologies that we use so all of Alps is implemented in Widely used object oriented programming languages So most of the code most of the libraries are implemented in C++ in particular all of the performance relevant parts So all of the low-level functionality that you need to run efficiently is Implemented in C++ where we make use of modern coding standards object oriented coding paradigms In particular we make extensive use of the C++ standard library So we use a lot of the data container structures in the C++ standard library and we make a lot of use of the boost libraries Which add a lot of functionality to C++ and really make it a lot easier to implement many things Without having to you know reinvent the wheel over and over again And then a lot of the higher-level functionality and the data analysis and evaluation functionalities implemented in Python Which I understand You've already dealt with in the summer school at various points and there we make excessive use or extensive use of the NumPy and SciPy libraries and matplotlib for all the computations to keep that reasonably efficient and then for high quality figure output so that you can use the software package for the data evaluation to immediately produce kind of a print-ready plot that you can use in your paper And then I mentioned in the beginning that we define standard file formats which are based on HDF5 which is a binary file format It allows you to very efficiently store very large data sets and then we use XML For human readable input and output so for smaller data sets that you want to be able to read immediately and I'll Speak more to that later So I want to discuss four different goals that we have That we try to achieve with the ARPS package And the first I want to talk about is the implementation of the efficient implementation of standard algorithms That solve a wide array of physics problems But that can also that can be used either really to solve some open questions that you'd like to solve in your research But also as as a testing and benchmarking tool So if you're developing some new algorithm you can use these applications to test and compare and make sure that your code is doing The right thing and producing the right results and this is reasonably efficient Compared to some previous implementations. So what are the algorithms? What are the applications that are implemented? So there's a classical Monte Carlo implementation, which is really You know a fairly basic implementation of local and cluster update algorithms for spin systems on the lettuce Then there's an exact diagonalization application which does either full diagonalization or spice diagonalization And really have a very wide array of models. So it's a very generic implementation you can input the model In a format that I'll be describing later And so it's maybe not the most efficient exact diagonalization code for high performance simulation So if you want to really push the boundary and do the largest system possible You'll probably have to implement a more specific Implementation that's optimized for your specific model, but as far as codes go that can solve, you know, reliably solve a very wide Array of problems the ed code in apps is really very powerful and in particular is very powerful for testing your own code So you can you know double-check for some small system whether your implementation gives the same result as the code in alps Then alps implements several quantum Monte Carlo methods It implements the stochastic series expansion, which I understand was discussed by Anna Sandvik here last week It as a code called the loop code, which is basically a word line spin Worldline Monte Carlo for spins The continuous warm continuous time warm algorithm and an extended ensemble, which is basically a quantum one lambda algorithm I'll say more about the differences between all these different Monte Carlo codes Basically they're all you know, most efficient in a particular limit. So depending on the specific problem You can use different codes in in the alps software package That will be more that'll be optimal for the specific application that you have in mind and as I said I'll say more about which code to use when And then finally alps implements tensor network methods So there's an implementation of the density matrix realisation group, which was introduced by Steve White here I guess two weeks ago now There's an implementation of the time-evolving block destination method and then the most recent addition to alps is an implementation of DMIG in the language of matrix product states Which is actually a code both for grants finding granted and for performing time evolution in a very efficient way And then finally there's an implementation of the dynamical mean field theory Which I'm not sure has been mentioned at this summer school yet and in the tutorial session this afternoon You'll be using two of these codes. You'll be using the directed loop SSE code, which is a very efficient quantum Monte Carlo code for spin systems and you'll be using the matrix product state implementations to To look at the physics of Heisenberg spin chains and spin ladders So I've discussed the Implementation of standard arguments that are available as part of the alps package the next thing I want to discuss is how in alps we try to facilitate repeat visibility by using standard file format and using appropriate provenance mechanisms So what is all this about so imagine, you know at some point early in your PhD you run some simulation So as an illustration, I went on my heart is kind of looked around for some really old file that I went back when I was an undergrad student and I found this file this is just a couple lines out of that file and Some plot that are generated from it now what what's the problem with this so the problem is I don't really remember What I simulated here right so I can look at the path. Okay, so I probably did an iPad simulation I don't really know what this model is. It was the second one of something Some parameter was set M equals to 2. I think that's the bottom engine P I don't know what it is and as I don't know what it is So the problem I'm trying to illustrate here is if you if you just run a simulation and you put it on a text For somewhere on your heart disk You'll forget what you did and then a couple years later You'll be writing up your thesis and you'll be asking yourself. Well, how did I generate this plot? You know, what were the parameters that I used to to generate this figure? What version of the code that I vote did I did I use for this? Did I you know, what was the post-processing? How did I fit this data? So? the challenge is to find a way to to Keep track of that information right and this is obviously very bad way of doing it. So I abandoned that But you know back in the old days. That's how people did this and and How to achieve this that you store the information about the data together with the data goes under the name of provenance So if you look up provenance You find several definitions the definition that's relevant here Is that provenance mean that you keep a copy of the history of a piece of data the intermediate pieces of data utilized to compute? final data and Then you keep the execution history of computer processes, which were utilized to compute a final piece of data So what does it mean to preserve this information? What do you want to do? You want to store information such as who created some data set and when was it created? What application was used what code was used which version of the code was used? to create this data what parameters were passed to the to the to the application you know what What was the input that you used and then what post processing was performed? You know to go from the raw data that your simulations without to some figure that you stored and that you want to put finally in a paper or into your theaters and so what we try to achieve in alps is to facilitate the recording of this kind of data and We do this in two ways one is to produce to have Standard file formats both for the input parameters and for the output parameter of the output data for the output of the application So this way, you know you can first of all Yourself remember, you know what the input parameters were you can you know you have you have them in some format that a couple years later You'll still be able to understand you can look at the output data and you'll still be able to understand You know what all those numbers mean you can also hand it to other people And other people will be able to understand what the data files mean because it's a standardized file format and people can just look up But what they're supposed to mean and Then what we also try to do is we try to provide actually automated mechanisms that record this kind of provenance information So that you don't have to do an extra effort and makes it really easy for you to have this information available later on And The ultimate goal of this would be not to just have this provenance information available for yourself but also make it accessible to other readers of your papers for example, so you could Embedded with a paper and send it to the publisher or the referee So for example if your paper gets refereed in a journal the referees would have access to all the steps that you took in Arriving at that final data and would be able to include that in the assessment of the paper And then also your readers could you know completely reproduce all of the steps that you took and make the process very transparent This goes under the name of reproducible papers and I'll say a little more about that later So what are some good provenance habits to keep in mind? And This is really independent of using this alp software's life You know package we try to make it easy, but you should really try to follow these steps, whatever Software you're using So you should use descriptive input formats So you know have you have an input format that that remains readable also after a few years don't use cryptic parameter names Use parameter names that are kind of easy to understand Try and store the input and the output of your simulation together so that you know a Couple years later you'll still have the file of the figure that you made it be good to have the input Stored in the same place so that you can look at what exactly where the input parameters that led to this specific figure That you now want to include in your thesis Don't hard-code simulation parameters because otherwise the result you know of your simulation will depend on the specific version Maybe you change the hard-coded parameters and you won't remember the change so that you know it's hard to document Really if you do that Use versioning software such as subversion or get to keep track of the different versions of your code This is really important because you know you'll be continually fixing Mistakes in your code and then you'll be asking yourself Did I do this simulation before I fix that or a bit after I fix that or and if you have versioning software you can You know look at what specific version you were used and whether that specific version had a mistake or not And you'll be able to know whether you have to repeat a simulation or not And then what's really important is to find a way to keep track of post-processing steps that you take So I would always suggest to you do post-processing such as data fitting or something like this in in Scripts rather than an interactive environment because if you do it in interactive environment You can never repeat the same steps You can't quite figure out you know what were the parameters used for some non-linear fit What was the initial parameter and these guys these kinds of things are lost if you use an interactive tool So it's much nicer to use a script where you can just look at the source code of the script that did the data analysis And you can figure out what exactly you did And then again, I would encourage you to store that together with the input Files and the output files of your simulation One way in which I can help you achieve all of these things is by integrating into the vistrade environment Which is a visual workflow and provenance management toolkit So visual workflow means you you know literally drag together these workflows that one kind of top to bottom up here You have you know running some simulation and alps and then all of the different steps in your data analysis Are the different boxes here the data flows along these lines that at the very end down here You have a final figure That you would include in your paper And so vistrade is a software package that allows you to do this and we have a Integration into alps where you can call all the apps applications and data analysis tools from within this vistrade Environment and then what vistrade also does it it keeps an exploration history So it keeps the history as you change The workflow of every version of the workflow that you use and so you can look back or what did I do back in the day You know what was the first version of this and so on you can tag versions and so on Ideally what this allows you to do is to write executable papers or with reducible papers So the idea here is that a paper is not just a PDF with a bunch of data figures in it But that from the paper you can actually access all of the raw data that went to it into it and all of the analysis steps So the Bay the paper would link to some repository where you store all of that information Could link to visualizations and so on and so forth for discussion of this I would recommend you take a look at this paper And actually one example of such an executable paper is the most recent Alps paper the Alps 2.0 paper If you look at the archive version of this paper, you'll see that there's ancillary files Included with the paper and these ancillary files are actually Workflows that are used to generate the figures in the paper They're also if you look in the published version at J study can look at the supplementary data and these Vistra's files are included and then finally if you look at a figure in the paper You'll see that you can actually click on the figure that will bring up a file that contains the entire workflow of Steps that was used to generate that particular figure in the paper So the Alps paper is actually itself an example of a paper that embeds all of the information about how the data was created within the paper Okay, so that's what I wanted to say about repeat visibility and and and provenance management So another step on another component of Alps is that we provide libraries that should hopefully simplify The development of reliable simulation codes. There's many libraries Contained within Alps. So let me just mention some of the key ones. One is the Alps scheduler Which allows you to Paralyze quantum Monte Carlo simulations using MPI very efficiently and very easily also for quantum Monte Carlo this There are observables So what this allows you to do is to collect your data in a quantum Monte Carlo simulation and do an error analysis Extremely efficiently. So this scales to several thousands of nodes very efficiently and it's hard to do otherwise So, you know Paralyzing quantum Monte Carlo is fairly simple until you get to the point where doing the error analysis on a single note It becomes too time-consuming and so what this does is basically a distributed way of doing the error analysis Which makes it much more efficient and much much easier to implement kind of large-scale quantum Monte Carlo simulation So I would really encourage you to look into these two libraries if you're planning to use to do some high-performance quantum Monte Carlo There's model and lettuce libraries which allow you to define Letters models and and and and letters structures, and I'll be discussing a little bit about this There's there's a parameter library We may be not all that important and then there's a very nice implementation of An interface for HDF 5 which is the binary data format that I mentioned in the beginning So we provide a very nice C++ and Python interface that allows you to use this data format in kind of a very clean way And I would claim that that's actually a nicer implementation of the HDF 5 C++ libraries and the one that HDF 5 itself provides So I would also encourage you to look into these HDF 5 library if you have to store large data sets And I should emphasize that a lot of these libraries can be used independently from the rest So you can use the HDF 5 library even if you're not using the scheduler Or you can use the scheduler even if you're not using the model library and so on So really these things kind of factor out and you can just take what you need For you know the application at hand that you're trying to develop Yeah, so There is a matrix library as part of the dmg implementation Which is It's basically just a data container and all of the numericals Computations are outsourced to lay back and blast and that's a very efficient Matrix library for for basically running on a single node If you're thinking about matrix is distributed over several nodes We actually have that also in the dmg application, but it's not very well documented So at this point that that's not really available yet But will be available in the future. You mean in the context of like the Monte Carlo libraries So I think in that context it basically means that the that the scaling is near optimal So in particular the so the observables here the the quantum Monte Carlo evaluation tools only use MPI collective operations So basically all of the efficiency depends only on the underlying MPI library So the scaling with a number of nodes, you know should be Basically optimal assuming that your MPI implementation is optimal. Yes. I mentioned it. Okay. I mentioned that Right. And so the final Thing I want to briefly mention are these data analysis tools Which are built into a Python package called PI alps that's built around non pi sci-fi and mudblood lip and Allows you to work with the output data from alps simulations But also any other output data and do plotting and so on and so forth It's actually centered around a data structure that you'll encounter in the afternoon hands-on. So that's why briefly mentioned here So the data set is just a simple class that contains really only three elements x y and props X y is where you encode your data in whatever format you really want and props is a dictionary that contains all of the information about the data set so it's this really simple data structure that kind of permeates all of the PI alps libraries and There's a lot of functions for dealing with this so you can load XML data or HD a five data into this data set You can create plots directly from the data sets. You can Kind of collect data. So you say you want to plot, you know X versus Y it can automatically create that kind of plot and so on. Yes. Yes. Yes Yeah, so oh, yeah, that's a good point. I should have mentioned that so in the in the Python library There's actually numerical type That implements our bars and our propagation And if you do the plotting it'll automatically do our boss and all that that'll actually come up in the in the afternoon tutorial So now say you want to run an alps simulation with one of the alps applications How do you set this up? So there's three components to this so first you have to define a letters Then you have to define a model and then you have to kind of combine it and provide a set of parameters So this is just a simple example where the letters would be a chain letters The model is a spin model and then here are some example parameters This together provides the definition of a physical lattice system and then you can feed this definition of a physical lattice system into Any of the alps application so you could run exact organization on it You could run quantum Monte Carlo on it or you could run any of the tensor network methods such as MPS time evolution or DMID grand state search on this All of these input parameters are given as XML files So let me briefly describe what XML is XML sense or extended markup language markup language means that it's a text-based format which mixes The the data basically the text With special tags that that tell the computer what the data means So it's a format that at the same time it seems to be human readable So other than you know the binary format that you kind of immediately look at you can just open this and read it But at the same time it's it's structured in a way that it's machine readable So the computer can automatically pass this Kind of XML files one example of XML is actually HTML is basically a variant of XML And many of you have probably seen HTML files. So here you have the tags and closed in these In the brackets. So for example, this tag will tell you that it's the beginning of an HTML document All the tags have a closing tag. So this is the opening tag. This is the closing tag The closing tag has the slash at the beginning And then this would this tag h1 in an HTML document just in you know tells the computer that it's a heading And then within the tags you have the data. So here, you know the heading which is read header And then this is another tag. So this tag this includes an image And you can can add attributes to to an image. So here for example, the source of the image would be In which a jpeg and this tag has no closing tag. So there's a slash at the end That's really all you need to know about the syntax of XML Let's look at some examples in the context of art. So for example in the lattice library, you would find something like this So here we're defining a chain letter. So just a one-dimensional chain So first you define the letters, which is really the private lettuce. So it's an infinite lettuce You only provide a basis vector called a here and the length of the Length of that is just set to one by default and then you provide the reciprocal basis Which is really not that important for most things that we'll be doing here Then you add to that a unit cell So to have a simple 1d chain with only one side for unit cell the unit cell description is extremely simple It's called why it's called simple 1d. So in this unit cell you have one vertex and one edge So basically what this looks like is you have one vertex and then one edge going to the next Unit cell so you see here that there's we define one edge The source is vertex one and the target is also vertex one, but it's offset by one unit cell And then you can combine these two things together and define a lattice graph Which is now not an infinite letters, but a finite letters. So here you take The chain lettuce together with the simple 1d unit cell and now you make it finite So you provide an extent so we say that in the one dimension that we have the length is L So we have L unit cells in one dimension and then we select boundary conditions So here we tell that periodic boundary conditions you can alternatively we have open boundary conditions Let's look at another example, this is the square lettuce so here in the square lettuce We define two basis vectors, which are basically These two letters basis vectors the lettuce spacing is again by default set to one and we define the reciprocal vectors The unit cell is again a very simple unit cell with again only one side But now there's two two edges. So there's one Going this way and one going this way So we define one vertex, but two edges both starting from vertex one going to vertex one But the offset is different so in one case it's offset in by one unit cell in the y-direction You have the case in the x-direction and then we again compare Put these two together to have a lettuce graph which now has two dimensions. So two extents w and L There should be oh, yeah, so there's two extents here and we set the default of w to be L So if you just provide L you get a square lettuce L by L sites The third option is so so just a third example is you can just provide a graph like this There you don't have to worry about, you know, lettuce basis vectors with reciprocal basis vectors Any of this you just provide a number of edges to different vertices and then it'll automatically figure it out Many lettuces that you'd be using Are already predefined so for example chain lettuce open chain lettuce square lettuce triangular and so on Are already defined in this file So if you want if you need a different lettuce just take a look in here first if it's maybe already there And otherwise you can use some of the examples there and modify it for your own needs to define the lettuce and also online You can find an extensive tutorial on how to define more complicated lettuces Then we have the model library so in the model library you first define basically a Hilbert space Which is the side basis so this is the side basis for a spin model The side basis is defined in terms of two quantum numbers total spin S and The Z component of the spin as Z. So these are basically the basis states And then based on that Hilbert space you define a set of operators So the natural operators to work in here are as plus as minus and as Z Which act on the states in the usual fashion that you know from your quantum mechanics lecture So as plus you know raises the AC component as minus lowers the AC component and as he just Give you the eigenvalue of the AC component and Then basically you from the side basis you have to go to a basis which for all Simple purposes the same thing And then you finally define a Hamiltonian Hamiltonians and alps are restricted to having to acting on the site on a bond So if you need something more complicated than a bond operator, that's unfortunately not not possible right now But still this is a pretty broad class of Hamiltonians the terms that are defined in the spin Hamiltonian So the side term is basically a field in the z direction a field in the x direction And then a field that couples to the square of the Z The component and then the bond is basically a Heisenberg model So you have a coupling in the z direction you have an exchange hopping coupling and you can have a bilinear Bicroatic term of course these two terms so the SC square term and the bilinear bico-radic only makes sense for spin one or larger But this is this is basically how you define a model in alps and again there's many models already implemented So this spin model actually I just copied this out of out of the files that are already there both of Fermi Hubbard models I Implemented spinless fermions TJ models. So a lot of the models that you'll likely be working with are already there by default in alps So how do you run an alps simulation? So there's three different ways one would be to run it from the command line here you just And prepare an input file by hand in your favorite text editor, and then you run the command of alps just from the command file command line This has the advantage that you don't actually need Python to do this. So it has the minimal amount of external dependencies This is how I suggest to use alps if you're running it on a cluster say because it's easiest to do remotely and it offers the greatest Flexibility, but it is a little bit cumbersome then you can run it from Python Python you can of course run from the command line, but you can also use it interactively Which is what we'll be doing this afternoon So it's very convenient if you're exploring new things because you have this way of interactively running alps simulations and So whenever Python is available I would suggest you actually use Python rather than the command line and then finally you can run it as I mentioned from this vis-trades provenance package which also allows interactive use and Automatically tracks the provenance information for you. So it's very convenient in that way, but of course you need to use you know this framework which Takes some getting used to so I would suggest that you play around with this a little bit But we won't be doing that this afternoon. So this afternoon will only be using it from Python Python I assume is familiar to most of you So it's a very easy to write portable and very widely used interpret interpret the programming language All of the current Python code in alps is tested only against version 2.7 So in the current version of alps, I think there's some problems if you want to run in Python 3 So I suggest you stay away from Python 3 If you want to learn more about Python you can wait for Chris Laumann's lectures later in the week Or there's many online tutorials that you can look at One thing I suggest to look at is I Python sense for interactive Python It's basically an improved Python shell has things like command history and so on so it makes it very convenient to work with Python on the command line and then even nicer is something called I Python notebook I'm the most recent version called Jupiter, which is the browser interface for running Python And it basically offers you both the you know the full advantage of an interactive interface where you can in your browser Change the commands look at the output and so on But at the same time at the end you can save the notebook that you have all the information of what you did So it's really the best of both worlds between an interactive and and in the scripted environment For those of you who are familiar with Mathematica or MATLAB this will probably be very familiar So it's very similar to Mathematica's interface in many ways, and that's what we'll be using this afternoon This is what you can expect to see in a in a I Python notebook. So this will open up in your browser So the notebooks are organized in cells and cells can be either code cells or markup cells Markup cells can basically contain comments, but they can also come contain latex equations and so on So these are very useful for documenting your code and describing what the code is doing And then the cell The command cell contains just regular Python code which you execute by hitting shift enter just as in Mathematica And then you can actually have the figures come up in line in the browser And they could start along with With the code and all that so it's a very nice interface For for using Python and doing data analysis and so on I Mentioned that we'll be using the quantum one quantum Monte Carlo and one Matrix product data application. Let me say a little more about these applications So as I mentioned in the beginning, there's many different quantum Monte Carlo codes And the difference may not be immediately clear So for a given problem if you have the question which quantum Monte Carlo code should you use I suggest you look at this website Which is on the Ips wiki So basically the looper code is the most specific quantum Monte Carlo code Because it needs a lot of symmetry. So you need you one cross C2 symmetry you need Basically a C conservation and a spin inversion symmetry But if you have those symmetries, it's the most efficient code The directed loop SSE code allows you to break the spin inversion symmetry so it allows you to add say a magnetic field and In that case would be the most efficient Implementation it becomes less efficient if you go to very large spin, or if you go to bosons with a large You know Software bosons where you can potentially have a lot of boson on each side in that case the warm algorithm is more efficient So if you're doing both Hubbard models without a hardcore constraint The warm algorithm would be best and then finally the quantum Wang Lando code is a fairly specific application that uses a different type of Monte Carlo procedure That is specifically suited for calculating things that otherwise require thermodynamic integration So if you want to calculate say the free energy or the thermodynamic entropy of a system, that's generally very difficult in Monte Carlo You have to run Do simulations at many different temperatures and integrate down from infinite temperatures is a very tedious process and Quantum Wang Lando makes this very easy So if you're interested in these thermodynamic quantities the quantum one Lando code would be the black one to use DMRG again, there's different implementations. So there's an application. That's just called DMRG, which is kind of a traditional DMRG code Was written a few years ago. It's very reliable for one-dimensional systems, but it's maybe not the most efficient by modern standards So I would suggest you use this for testing or for simple 1d cases But in other cases, I would probably recommend other codes the TV decode Is specifically time evolution and very special models So can be can be good in certain circumstances But it's not as generic as the other ones and then finally the MPS code Which is the most recent one is a very generic modern implementation of DMRG in the language of matrix product states Which has many advantages over the other code So in particular it allows you to do ground state and time evolution within the same interface the same structure So for example, you can prepare a ground state and then do a quantum crunch on it and study the time evolution of that crunch All within the same software package. So it's very flexible in that sense It's it's very efficient also for models beyond one dimension So if you want to do quasi one-dimensional systems wide ladders and so on which has been very popular for DMRG in the last Three years, this would be a very good very good code to use and then the performance is very good So we've run simulations up to 10,000 states and more for granted search at least and Here's a small table that I took out of our paper comparing it to other open source code so I think it's the most efficient open source implementation of DMRG right now and Is I think as efficient as any other DMRG code That exists right now if you want to learn more about this we actually had a paper last year in Computer physics communications that explains a lot of the implementation details of this MPS code Okay, so finally now if you want to do something with alps, how do you get it? The central place to go would be alps.com first of all, which is the website that has everything related to alps If you want to install alps you would go to download and installation down here So there's binary installation packages available for certain Linux distributions for Mac OS and for Windows So one caveat with the binary installation is that it relies on vistrails for the Python interpreter Because we have to make sure that you have exactly the right version of Python So you need to install vistrails first. You don't have to use it, but you have to install it first If you want to use the Python functionality in alps It's the easiest installation if you Use the binary installation, but of course it offers the least flexibility. So alternatively you can install alps from source This is something that I would really recommend only on Linux and Mac OS doing the source installation on Windows as possible But it's fairly tedious because it's difficult to find all the external dependencies On Windows, but of course the source installation offers you the most flexibility So you can use your favorite version of Python, you can use your favorite version of MPI and all the other external libraries I would recommend that if you plan to actually use the alps libraries, the C++ libraries that you install from source So that you can make, you know Make sure that everything works within your compiler environment and so on And also if you're going to run alps on a cluster, there's pretty much no way around doing the source installation I always recommend getting the most recent version of alps that you can For the tutorials if you want to run those yourself You'd need to use the pre-release 2.2.0 B4 Which is the most recent version you'll find on those actually just released yesterday night For a source installation, I generally actually recommend using the subversion tongue So there's a link on the website where you can always get the Newest version from the repository and this is what I would recommend if you're actually going to do any development The good news is that for the tutorial this afternoon, you don't have to do any of the installation yourself Because everything is installed on the lab computers and we'll be using the lab computers If later during the week you want to do your own simulations without you want to run it on your own laptop Come find me and I can help you install it. Yes So it depends if you if you do a source installation, then you don't But if you do a binary installation, then you do the reason is that to to because we have Binary Python libraries and those need to be produced for a very specific version of Python So if you use you know one version earlier later, it doesn't work anymore And so to guarantee that you have exactly the right version of Python. We just use the one from this track But if you have a source installation, you can use you know Your own Python installation that you already have and you just tell it during the compilation where to look for Python A word about license conditions So Alps has a special license, which is really a version of the BSD license The key condition here is that if you publish any results based on Alps We ask you to cite the alps publications So in particular for any part of the alps, you should cite these two papers For the DMFT codes, you have to cite this recent paper and for the MPS code You have to cite our computer physics communications in the alps installation you'll find a Document called citations.txt that lists in detail for which part of alps you should cite which paper But I would really ask you to You know follow this and and and cite our papers because this is of course what encourages people to contribute to alps You know that that using with with the citations There's some scientific credit given to those who put you know their time and effort into the alps libraries As I said for the tutorials this afternoon all of this will happen on the lab workstations So you don't need to do any installation Ask me if you still want to install it after the tutorials And there'll be two tutorials that will be going through this afternoon One is based on quantum Monte Carlo and one is based on DMRG or rather the MPS implementation of DMRG There's many more tutorials available So if you go to the alps website you can find down here a link to all the tutorials and there's tutorials for practically every application in alps and also many of the libraries The Python packages and so on So if you want to write your own code based on alps you can find Many tutorials for that and I would encourage you if you're interested to play around with those tutorials and ask me if You have any questions about it The tutorials this afternoon I actually prepared this page specifically so at the very bottom of this page You'll find a little link that says trieste tutorials. Those are the ones for this afternoon and You can also down find them on the lab computers under this Part and so at this point let me switch gear a little bit and say a few words about the About the tutorials that we'll be doing and And so we'll be looking at the physics of Heisenberg models in quasi one dimension So the Heisenberg model. I'm sure it's familiar to everyone at this point probably has come up a number of times It's first just consider the the chain. We will be considering the spin one-half case. So we're So to get some intuition let's first look at the classical limit So in the classical limit This spin operator just gets replaced by an o3 vector. So s is simply a vector under some normalization constraint And so now the ground state of this is fairly simple so if j is equal to minus one then The Hamiltonian favors alignment of the spins so adjacent spins want to point in the same direction So the ground state will be say all spins up or all spins down And so you'd call that a foul magnet. Can if you're wide below this, can you still read that? Yes? No, maybe It's okay I'll just continue and so in the other case for j equals plus one the Hamiltonian Energetically favors that the spins anti-align so if one spin is pointing up the adjacent spin wants to point down And this is called an anti-fail magnet So that's the intuition in the classical case in the quantum case The world gets a little more complicated, but also a lot more interesting So to understand the classical of the quantum case, it's important to note that the system has an SU2 symmetry so what that means is The Hamiltonian commutes with the operator s squared and Commutes with the operator SC So in particular this means that it preserves the total spin and it preserves the SC component of the spin and Of course all of the eigen states of this Hamiltonian can be organized Into states with the well-defined total spin and a well-defined Z component of the spin If we just look at two sides, we know that two sides we have two spin one-halves the tensor product of these two spin on half Hilbert spaces just by SU two spin addition gives you a spin zero and a spin one Hilbert space And so we can organize the states on two sides Into a representation that has been zero which is called the singlet and one that has been one which is called the triplet So the singlet state that's the state with s equals zero and SC equal to zero is This up down minus down up and then the triplet states There's three of them. So the minus one state is Both down there's the plus one state which is both up and Then there's the zero state which is up down Plus down up and so by SU two symmetry we know that the Energy of these states cannot depend on the SC quantum number So all of the triplet states must have the same energy and singlet state has an energy if you calculate these you'll see that the singlet state is an eigen state with eigenvalue minus three half and the triplet states Any of them is an eigen state with eigenvalue one and so you see that if the if we go through this analysis again if the coupling coefficient is negative and We favor large eigenvalues. So if the coupling is negative the triplet state will be favored and if the so this is basically the Firm magnetic case J equals plus one minus one and If the coupling is anti-firm magnetic, so we have J equals plus one then the singlet state will be favored this will be the ground state on on two sides So now if we go beyond two sides and we try to construct an extended system We note that there's a very interesting difference between the power magnet and the anti-firm and so for the fellow magnet The states the ground state has quantum numbers total spin is L over two and SC is just anything That's allowed you can see so for two sides we found that the ground state of the so this is for the fellow magnet This is j equals minus one For two sides we found that the ground state has been one and this just goes So if you have L sides the total spin of the ground state of the fellow magnet is L over two And so if you look at all the allowed states So, you know all the states that have as Z compatible with this you'll find that for example one perfectly fine ground state of The fellow magnet is the state with all up Which is the state that has s equals L over two and SC equals L over two The perfectly fine ground state of the fellow magnet and you see that this state is not entangled It's a purely classical product state, but there's no quantum mechanics here This is just a classical state basically now if you do the same analysis for the anti-firm magnet You get a very different picture. So the ground state for the anti-firm magnet Actually has spin zero and SC equals zero We saw that for the two-side case you can actually convince yourself It's a little more complicated that this is true in general. So the ground state of the anti-firm is always a singlet But such a singlet state you cannot actually construct as a product state So the the ground state of the anti-firm magnet is not a simple product state You could think that it's a state like this just up down up down up down But if you look at it a couple lines of algebra will show you that this is not an eigenstate of H We already saw that in the two-side example So if you look at the singlet state, this is an entangled state indeed This is a maximally entangled state So if you calculate the entanglement of the first spin with a second spin in the singlet state It's locked to which is the maximum value that it can take and So this basically extends and the ground state of the of the anti-firm magnet is much more entangled than the ground state of the Firm magnet so in some sense in this sense the anti-firm magnet is much more interesting than the firm magnet and so we'll be concentrating on that on the on the anti-firm magnetic case for the for the afternoon tutorials So what else do we need to know about the anti-firm magnet So one important piece of information is the Merman-Wagner theorem Which states that there's no spontaneous symmetry breaking In a one of a continuous symmetry in a 1d quantum system so what it tells us is that the Heisenberg anti-firm magnet cannot you know, it's it we call it an anti-firm magnet But it's not really magnetically ordered. So if you calculate a correlation function like this, this actually has to vanish as You take the distance between the sides to infinity Right so in a classical magnet, which is ordered We have some order parameter the se2 symmetry would be other the o3 symmetry would be broken And if you calculate these correlation functions, you would actually detect that symmetry breaking but because we in one dimension and this is a continuous symmetry the symmetry cannot be spontaneously broken and The system is not really a magnet in in one dimension This is an important piece of information to keep in mind Now the question that we'll be looking at this afternoon is What the low energy spectrum of this system looks like? In particular, we'll be looking into the question of whether the system is gapped or gapless Which means whether the energy difference between the first excited states and and we call E n the Eigen states or the eigen energies Of the Hamiltonian where n is just an integer index that you know easy row is the ground state and so on And so the question we'll be looking at Is whether the gap which is the difference between the energy of the first excited state minus the energy of the ground state Vanishes or not a vanish. I mean so if it's Let's say if it's gapless if this vanishes it means that this This energy gap as a function of L will vanish as some polynomial in L the L to the alpha For some in some some exponent alpha, you know plus sub leading corrections and by gap I mean that the gap Delta of L will be some constant Exponentially small corrections. I hope everybody's familiar with the big O notation just means that all the other terms here bounded from above by By something that decays like this and here Kai is some characteristic length scale On which the corrections to this to this constant gap decays so the question we'll be asking is Whether the Heisenberg spin chain defined here is gapless or gapped Will actually be asking a slightly more specific question Namely whether the so-called triplet gap vanishes the triplet gap is just defined as the Ground state for sc equals to one minus the ground state For sc equals to zero It's a very naive way you can think of that as the excitation to a spin flip so the cartoon Of the ground state is something like this As I said, this is not really the ground state This is not actually an eigenstate and it's not magnetically ordered So this is really just a cartoon But you could think of making a spin one excitation by just turning one spin around And so the question that we're asking is what's the what's the energy cost? For breaking this pattern and turning one spin around and that's called the triplet gap Okay Or erase the Hamiltonian just to write it down again So this is for the Heisenberg spin chain Another interesting case would be the 2d systems instead of 1d 2d. For example, we could study the square letters The it being the square letters is not so important. So what's important is that it's a bipartite letters So you can divide it into letters a and b so a is only surrounded by b sides and b is only surrounded by a sides So now the Hamiltonian would be This is a notation that you'll come across in many papers So the the brackets here means that the sum of our ij runs over newest neighbors ij So it only runs over the bonds in the scarlet is here So now this is a 2d system 2d quantum systems the moment Wagner theorem doesn't apply anymore So in this case the system can actually spontaneously break the se2 symmetry and if you calculate now this Correlation function, you'll see that this goes to a finite value of the magnetization that is not equal to zero as You take this Two sides very far apart So the physics of the 2d case is very different from the 1d case and that this is truly a magnet and Basically to the classical cartoon picture of up and down spin applies here up to some quantum fluctuations So in the classical case, this would just be the maximum value would be One quarter, but in the quantum case is going to be slightly less than that but up to this kind of Renormalization of the parameters This is really kind of well described by the classical case which is in strong contrast to the 1d case Now we won't quite be doing the 2d case this afternoon But we'll be doing spin ladders So we'll be studying this system with two ladder ladder systems are often used In cases where you know the 2d physics is very complicated and not understood But the 1d physics is well understood and then you can approach the 2d By kind of step by step going from one to two dimensions So you take here in this case We just take two chains and we stack them up But you could imagine Stacking more and more chains on this and kind of systematically approaching the two-dimensional limit from some 1d limit that we understand So This is still in some sense a one-dimensional system called a quasi one-dimensional system So there's no spontaneous symmetry breaking for any finite width of the ladder So the crossover from 1d to 2d in this case is fairly interesting And it actually turns out that this with two ladder has a physics physical behavior That's very distinct from both the chain and the 2d case So it doesn't it doesn't magnetically order like the 2d case But it is also very different from the from the simple chain And we'll be looking for this difference in particular It turns out that as you'll see the spectral gap this triplet gap is a very good indicator of the difference between this ladder and the chain So we'll be using two different numerical methods first. We'll be using quantum Monte Carlo So here we sim we're simulating a canonical partition function So what we can calculate here is thermal expectation values so for some observable O we can calculate the Expectation value at inverse temperature beta Let me just In case this is not familiar beta is just one over T I don't know if you've come across this quantum Monte Carlo people use this notation quite a bit Which is defined as one over Z trace O times Even the minus beta H So this is strange right I said that we'll be calculating the spectral gap the spectral gap is not really an observable quantity in this sense But I cannot calculate Some local operator O and directly extract the spectral gap and in particular because this is a finite temperature method It really doesn't have access to to excited state energies So we'll be using a little bit of a workaround So instead of calculating the spectral gap we'll be here calculating a very closely related quantity Which is the magnetization curve at very small magnetic field So we'll modify the Hamiltonian and add a Zeeman magnetic field So add a small magnetic field that couples to the z direction of the spin So this Hamiltonian breaks explicitly SU 2 symmetry It still preserves the z quantum number, but it doesn't preserve the other directions of SU 2 And so we'll be calculating the magnetization curve M of H So we apply eight magnetic fields age of different strength very small magnetic fields and see how the magnetization, which is basically extracted from this Behaves as a function of the applied magnetic field and I Encourage you to work out actually why this is a good indicator of the spectral gap The intuitive argument is is is fairly simple So we know that the ground state is a singlet But the first excited state has one spin flip. So it has a finite magnetization So basically this adding this magnetic field favor states with some magnetization And so they'll get some weight in the partition function as you you know as you change the parameter of the magnetic field and depending on how large the spectral gap is that Reaction to the magnetic field would be more or less strong. So if we have a finite gap the system will react only in a very weak way to the magnetic field and If the spectral gap is very small doing the system will react more strongly to an external magnetic field But I would encourage you to work this out for a simple model So you can just take say a model of two sides and try to figure out the magnetization as a function of of External field in that case should be a fairly simple calculation So that's the DMG approach, sorry, that's the QMC approach And we'll be solving exactly the same Hamiltonians using DMG or rather the MPS grand state Algorithm so this is an eigen state method, right? DMG extracts eigen states of the Hamiltonian So here we have direct access to To the spectral gap In particular in DMG we can use make we can make use of quantum numbers So the MPS implementation makes use of a billion quantum numbers such as the sz quantum numbers so we can run separate simulations So we basically want two simulations each with a fixed value of the total sz Emily zero and one and So we basically calculate the ground state energy in the in this quantum number sector and in this quantum number sector and then compare the results and In that way we get immediate access to the triplet gap as a functional system size So whereas here we're applying an external magnetic field Which we're kind of slowly tuning to zero and watching the reaction of the system to that here We just directly simulate Or just directly calculate the gap for two different Quantum number sectors and get that information immediately in this in this tutorial also worked out another approach, which is yes in principle yes so the the code does write out the The entire matrix product state as an hg of 5 file in the end So if you're if you're interested in looking at those I can explain how to how to get them out I mean they're in some binary format, so Yeah, I'd have to explain the format, but those are definitely accessible Yeah, a standard field would do just as well as this field basically that doesn't matter You couldn't principle apply any perturbation. Yeah, so here since we're particularly interested in the triplet gap It makes sense to add a perturbation that splits the singlet state and the first excited state with this flip spin So that's why applying a magnetic field Makes makes sense in this case But if you're just interested in the in the gap in general and not the triplet gap You could indeed just apply any any weak perturbation to them Yeah, of course also we want to preserve the you want symmetry so there's not a whole lot of perturbations that you can add So this is kind of the most natural one to consider Yeah, so in the in the context of DMHG, let me just mention one completely different approach So as I'm sure has been discussed in great detail DMHG is a is a method that's based on Weekly entangled states, but also in particular gives you access to entanglement and to peace Which don't have an operational meaning and are therefore very difficult to calculate in quantum Monte Carlo, but very natural to calculate in DMHG so in particular the If you have a group of sites say we have a simulated chain with our sites eight sites What's very easy to calculate is you group your system into sites a and b and You calculate the phenomenon entanglement entropy of region a with region b where region a is a continuous block of sites So let me call the size of this little L So then we can calculate s of little L Which is the phenomenon entropy of the reduced density matrix on a this is the phenomenon entropy of Trace over b s of row is just the usual Minus trace row log row I'm sure you've come across this quite a number of times in the DMHG lectures now So what does this tell us about whether the system is gapped or gapless? And I'm sure this has been discussed, but let me just mention it again. So in 1d if we have a gapped system We know that the system has an area law This is due to a theorem by Hastings About ten years ago Area law in one dimension so every law means that the entanglement between blocks Grows only with the length of the cut or in one dimension the cut is only in one place So what an area law means is that s of L as I defined it over here is a constant This is the basis of the success of the DMHG method for one dimension If you have a gapless system in 1d And let me be slightly more specific if the dynamic or critical exponent is 1 If you don't know what that means don't worry about it too much But for kind of a very big class of critical gapless systems The entanglement entropy slightly violates this area law and so you'll find that s of L would follow C over 6 log little Where C is is a number that characterizes what's called the conformal field theory So it characterizes the field theory description of this critical 1d model And so what we can look for in the DMHG data in the entanglement entropy is the difference between this constant and the slow logarithmic divergence and In the simulations here you'll You'll see that one of the cases turns out to be gapless the other ones turns out to be gap And you can very clearly see that in the entanglement entropies and indeed for this system. It's very easy to extract the sample charge Which kind of fully characterizes the low energy description of the system So it's an interesting calculation to do that gives you some additional information about the system and Yeah, I should maybe mention if we calculate this for the ladder. What does it mean for the ladder? The ladder looks something like this So to simulate a ladder system in DMHG we always have to map it to a chain everything in DMHG always has to be mapped to a chain So here I just would choose some ordering of the sites. So it'll go. I don't know one two three four five six and so on And so The cuts are now defined for this mapping So for example little l equal to three would mean that a is basically this part So the natural cuts here are the ones where little l is is even so then you cut basically in places like this All right, that's really all I wanted to say a little bit ahead of time Are there any questions at this point Yes Right So it's definitely true that other fields are Much further along in this than condensed matter condensed matters really kind of everybody writing their own little codes and having their own file format if you look at high energy for example, they figured this out a long time ago and And and Yeah, we've definitely talked to people in other fields a lot of this work was done in collaboration with the group that develops this Vistria's package and so they think about provenance for living And so they they've worked with us But if you look at this, I give this one reference If you look at this paper, there's several test cases in there and I think I try to remember the other test case I think one was bio physics And I don't remember the other ones But there's definitely some exchange with other fields and these vista the Vistria's group basically does this professionally for living So if you're writing new models for Ips so Ips because it's open source You can just you know commit your changes to the main repository right, so There's different approaches to this. So I think increasingly publishers are encouraging that you Publish the data and the input and output along with your papers So many publishers these days will actually allow you to include that with a paper. So you for example, you could include it on the archive I Think APS has some mechanism if you if you publish in physical review They'll publish it along JSTAT did this with us where you can actually click on the paper This was actually something new for them. So I think this is the first paper Published in JSTAT that actually embedded the data in the paper But I think more and more publishers are encouraging this of course, it's it's good to have You know central repositories rather than your own website Because the lifetime of your own website is much shorter than the lifetime of a paper The paper somebody might want to look at in 30 years in 30 years You'll have moved five times and change web server five times And so your website will long be gone when people are still looking at the paper And there's other projects. So for example Harvard has a project called Dataverse It's part of the Harvard University Library and they have some kind of online storage system where you can upload your files So I think this is kind of getting more and more common that there's Long-term storage solutions libraries publishers and so on No, not in our MPS code. So that's an extension we're working on But currently it only allows you and sorry abelian symmetries So you can do general abelian symmetries, but not non-abelian symmetries or the width So that depends very much on the specifics of the model. So for the Heisenberg model and the square letters I'm sure you could do with 10 or 12 But that would be a very Time-consuming calculation. So basically You'll find that the entanglement entropy grows linearly with the width of the system That's so so s. So basically an area law in 2d. So this is the 1d case 2d if you have some system We call this L and this w and you map it to a chain like this Then s will be proportional to w and you know that to keep the accuracy the bond dimension has to be roughly exponential in in s some unknown exponent here So you'll get exponential scaling with the width of the system. So in the tutorials this afternoon I encourage you to play around with this and try you know with one two three maybe four Probably going beyond four or five you'd have to run simulations that would take longer than you know a couple of minutes and Then for with ten you're looking at simulations that will take probably hours to days But it then also depends very much on the behavior of the model. So You know how strong quantum fluctuations are so there's you know There's some some pre-factor here and the pre-factor very much depends on the specifics of the model So you really have to test For a given model how many states you have to use to get the accuracy that you need So maybe one thing I should say So if you look at the files in this directory There's an there's there's two different files. So there's six files. There's so there's QMC something or other and then DMRG so these are the two different tutorials and All of the tutorials exist in three different so both tutorials exist in three different versions One just ends in I pi and B This is the I Python notebook Then there's one that ends in dot v3 dot I pi and B and this would be the right one to use On the machines here. So the machines here have a slightly older version of Python So I recommend you use this one this one will give you an error message and then there's also one that just ends in dot pi This is just a regular Python script So if you want to repeat these tutorials not on the machines here But on some other machines where I Python notebook is not available. You can just run this Python script so this has a little bit less dependencies and To open that in the command line, you would just run I Python notebook So you so in the first step you would copy that file to your home directory Then I Python notebook will bring up, you know, the web interface and then in that web interface You can you can open these files and then from there on it should be hopefully self-explanatory and I'll be here to answer any questions Yeah Right, that's probably a good idea. Oh the the home is a network file system. Oh, yeah Yeah, then I would definitely use scratch is certainly for the DMRG tutorial because the DMRG tutorial provides a lot of files It's just kind of if everybody does that on a network file system that that won't end well Which yeah, yeah, you know, actually I'm not sure I think I think there's also a cluster implementation so there's the hybridization expansion and the her schwae And I think the her schwae is probably just single-site, but the The hybridization one is clusters, I think but you'd have to look at the paper by Emanuel and very intent company There's also there is DMFT tutorials, so if you're interested in DMFT feel free to look at those They take a while, but other than that thing. Okay