Hi Tianqi,
No need to make your own package or make a new function. You can follow the instructions in this section:
https://itensor.github.io/ITensors.jl/stable/AdvancedUsageGuide.html#Developing-ITensors.jl-1
to make your own local "development" version of ITensors.
Unfortunately that section needs more details and is a work in progress, but all you have to do is type the command `julia>] dev ITensors` (where `]` enters package mode at the Julia REPL). Then, if you edit the `dmrg` function in the file `~/.julia/dev/ITensors/src/mps/dmrg.jl`, you will see the changes you make when you use ITensors with `using ITensors`.
As that section mentions, if you install the package Revise with `julia>] add Revise`, it makes it so that when you edit your local version of ITensors found in `~/.julia/dev/ITensors`, you don't even have to restart Julia to see the change you make. You can test this by adding a print statement, like `println("Testing Revise")`, inside the `dmrg` function, and then run the `dmrg` function without restarting your Julia session.
To switch back to the "official" ITensors version you had installed, you can type `julia>] free ITensors`. The development version will still be saved and you can use it again by typing `julia>] dev ITensors`. This is the preferred way to develop a package, and you can use it to make a pull request to ITensors.
Let me know if you have any questions or if the process is confusing, I'll try to update that page with more details about the development process.
-Matt