In https://sourceforge.net/p/openmps/discussion/tech/thread/7dd1fa40/?limit=25#9544 the idea of a parity / global Z2 is mentioned, but I can't seem to implement it correctly. From that: " Discrete symmetries are of Ising Z2 type which looks to me like your case. Your symmetry generator would be the matrix with diagonal entries (0, 1, 0, 1, ...), in case with spinless fermions of all the same type only (0, 1)"
Is there some particular formatting to use? I attempted to creating an array of zeros, and put every other diagonal element as zero, but received some error. The numpy documentation recommends using arrays over a matrix specific formalism: https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.matrix.html.
Is there a way to use an OSMPS-defined operator for this? I think that this is already done in the 04_SpinlessFermions.py example with
I get an errors. In the first, the error is "TypeError: unfunc 'fmod' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''," while in the second I get the error "TypeError: unhashable tpe: 'numpy.ndarray'. "
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Operators is a dictionary list. A reference to something like Operators["nftotal"] should return a NumPy array representation for the operator with name "nftotal".
To use a custom global symmetry, you must first declare your operator in the Operators dictionary list with something like this:
So, the action of the d-level local operator should return a d-level local state that can be used to form the aggregate state via tensor product, and this d-level local operator should be abelian (it should not matter upon which site I measure first, and in what order I perform the measurement). As an example, for bosonic systems:
These operators would likely appear in the construction of your Hamiltonian, and you would use the aformentioned programmatic formalism to enforce a particular degree of evenness or oddness in the Majoranas.
If you provided me some more detail regarding your end goal, and what you hope OpenMPS outputs, I can help draft a more complete usage example for you.
Let me know!
P.S.
Regarding the usage of Discrete_generators: if I remember correctly, the use of the Discrete_generators as a simulation parameter is not yet supported and will always raise an exception.
The operators in Operators are ultimately passed to Fortran, and must be representable as a matrix acting on a state.
Last edit: Matthew Jones 2020-10-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That post I referenced had code using Discrete_generators was from 2016 - I thought it had been implemented - so I thought perhaps we should use that for global discrete symmetries. I'm not yet totally python literate - I'm learning python as I explore this tool (sorry!), so I'm missing a detailed understanding of things like Python dictionaries. I'll look into it tonight. Most of my python experience has been yelling at my machine for caring about number of spaces/tabs and not having explicit endings to loops and conditionals like in Fortran.
You have a -j in the definition of the even operator - is that for the site index?
My goal is to have a working, annotate example of the Kitaev wire model. Eventually, looping though the parameters to see the phase transition and the basic tools of the quantum information measures in OSMPS (and posting it here for others to use, too).
Attached is a version of this. The output seems to miss the Majorana quasiparticles - my guess is that it's because the parity symmetry isn't being enforced? The single particle correlations with the left-ege exponentially decay in magnitude, but don't rebound on the other side like the should if there are unpaired Majorana edge modes at opposite ends of the lattice.
I have a couple of questions on the quatum information measurements. I don't know if I should ask them in another topic or not.
For the mutual information matrix. When we examine say Outputs[0]['MI'][i][j], this gives the mutual information based on the reduced density matrices of sites i,j, correct? The documentation https://openmps.sourceforge.io/pyautodoc/obsterms.html#obsterms.MutualInformationObservable leads me to think that since the output is an L by L matrix for an L site lattice.
- Is there anything that would allow the mutual information / reduced density matrix of two regions in a lattice that has been cut into three pieces? The math is the same (in spirit) as say calculating the mutual information of sites 2 and 7 on a 10 site lattice. For instance, if we want to compute the mutual information of region A consisting of sites 1-3, with region C consisting of sites 8-10, we can do this using three cuts, all of which are bi-partite. Albeit, the bi-partite cut of region A+C is kinda strange to look at, but if we start with a globally pure state, A, C, A+C are all uniquely defined via the Schmidt decomposition.
We are always happy to provide additional context/insight where appropriate, No need to apologize!
Re: Discrete_generators ... yes, I would have assumed it was implemented, but didn't dig past documentation. Looks like it is (per Daniel's comment below)! Thanks for your patience.
I would recommend trying Daniel's fix for discrete generators, which should enforce exactly the parity you're looking for.
j is NumPy's representation for complex numerical objects (imaginary unit). Here's NumPy's documentation on np.imag with some examples involving.
Thanks for providing us with some additional context into your issue. For your questions involving mutual information, would you mind posting a new issue? This helps us with tracking/metrics, etc..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the discrete generator has to be a list of strings in your parameter
dictionary, in your case with one entry as you stated from the
04_SpinlessFermions.py example. Somewhere you have the class for the
operators which has also the basic features of a dictionary. Can you try
something like this:
In https://sourceforge.net/p/openmps/discussion/tech/thread/7dd1fa40/?limit=25#9544
the idea of a parity / global Z2 is mentioned, but I can't seem to
implement it correctly. From that: " Discrete symmetries are of Ising Z2
type which looks to me like your case. Your symmetry generator would be the
matrix with diagonal entries (0, 1, 0, 1, ...), in case with spinless
fermions of all the same type only (0, 1)"
Is there some particular formatting to use? I attempted to creating an
array of zeros, and put every other diagonal element as zero, but received
some error. The numpy documentation recommends using arrays over a matrix
specific formalism: https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.matrix.html.
Is there a way to use an OSMPS-defined operator for this? I think that
this is already done in the 04_SpinlessFermions.py example with
I get an errors. In the first, the error is "TypeError: unfunc 'fmod' not
supported for the input types, and the inputs could not be safely coerced
to any supported types according to the casting rule ''safe''," while in
the second I get the error "TypeError: unhashable tpe: 'numpy.ndarray'. "
inside the parameters definition, I get an error that the chemical potential term that I defined is not injective. I get the same error when I try to specify Discrete_quantum_numbers : [0] for the initial state inside the parameters definition.
Is there any reason that a symmetry generator would make an otherwise properly working operator not injective? I've attached an attempt to add the discrete symmetry generator alla Daniel's method in the Bose Hubbard model linked in my previous reply.
How do we implement global discrete symmetries?
In https://sourceforge.net/p/openmps/discussion/tech/thread/7dd1fa40/?limit=25#9544 the idea of a parity / global Z2 is mentioned, but I can't seem to implement it correctly. From that: " Discrete symmetries are of Ising Z2 type which looks to me like your case. Your symmetry generator would be the matrix with diagonal entries (0, 1, 0, 1, ...), in case with spinless fermions of all the same type only (0, 1)"
Is there some particular formatting to use? I attempted to creating an array of zeros, and put every other diagonal element as zero, but received some error. The numpy documentation recommends using arrays over a matrix specific formalism: https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.matrix.html.
Is there a way to use an OSMPS-defined operator for this? I think that this is already done in the 04_SpinlessFermions.py example with
For something like the Kitaev Wire Model (see, for example https://topocondmat.org/w1_topointro/1D.html#The-Kitaev-chain-model )
the evenness/oddness of the total number of fermions is conserved. But if I try
or
I get an errors. In the first, the error is "TypeError: unfunc 'fmod' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''," while in the second I get the error "TypeError: unhashable tpe: 'numpy.ndarray'. "
Great question, Jared.
Operators
is a dictionary list. A reference to something likeOperators["nftotal"]
should return a NumPy array representation for the operator with name"nftotal"
.To use a custom global symmetry, you must first declare your operator in the
Operators
dictionary list with something like this:Then, in your simulation parameters, insist that the system-global value is fixed:
So, the action of the d-level local operator should return a d-level local state that can be used to form the aggregate state via tensor product, and this d-level local operator should be abelian (it should not matter upon which site I measure first, and in what order I perform the measurement). As an example, for bosonic systems:
where, here, I'm insisting that there are 7 bosons on my 1D lattice.
With your specific system, it seems like you'd want to implement something like this:
These operators would likely appear in the construction of your Hamiltonian, and you would use the aformentioned programmatic formalism to enforce a particular degree of evenness or oddness in the Majoranas.
If you provided me some more detail regarding your end goal, and what you hope OpenMPS outputs, I can help draft a more complete usage example for you.
Let me know!
P.S.
Regarding the usage of
Discrete_generators
: if I remember correctly, the use of theDiscrete_generators
as a simulation parameter is not yet supported and will always raise an exception.The operators in
Operators
are ultimately passed to Fortran, and must be representable as a matrix acting on a state.Last edit: Matthew Jones 2020-10-25
Thank you.
That post I referenced had code using
Discrete_generators
was from 2016 - I thought it had been implemented - so I thought perhaps we should use that for global discrete symmetries. I'm not yet totally python literate - I'm learning python as I explore this tool (sorry!), so I'm missing a detailed understanding of things like Python dictionaries. I'll look into it tonight. Most of my python experience has been yelling at my machine for caring about number of spaces/tabs and not having explicit endings to loops and conditionals like in Fortran.You have a
-j
in the definition of the even operator - is that for the site index?My goal is to have a working, annotate example of the Kitaev wire model. Eventually, looping though the parameters to see the phase transition and the basic tools of the quantum information measures in OSMPS (and posting it here for others to use, too).
Attached is a version of this. The output seems to miss the Majorana quasiparticles - my guess is that it's because the parity symmetry isn't being enforced? The single particle correlations with the left-ege exponentially decay in magnitude, but don't rebound on the other side like the should if there are unpaired Majorana edge modes at opposite ends of the lattice.
I have a couple of questions on the quatum information measurements. I don't know if I should ask them in another topic or not.
For the mutual information matrix. When we examine say
Outputs[0]['MI'][i][j]
, this gives the mutual information based on the reduced density matrices of sites i,j, correct? The documentation https://openmps.sourceforge.io/pyautodoc/obsterms.html#obsterms.MutualInformationObservable leads me to think that since the output is an L by L matrix for an L site lattice.- Is there anything that would allow the mutual information / reduced density matrix of two regions in a lattice that has been cut into three pieces? The math is the same (in spirit) as say calculating the mutual information of sites 2 and 7 on a 10 site lattice. For instance, if we want to compute the mutual information of region A consisting of sites 1-3, with region C consisting of sites 8-10, we can do this using three cuts, all of which are bi-partite. Albeit, the bi-partite cut of region A+C is kinda strange to look at, but if we start with a globally pure state, A, C, A+C are all uniquely defined via the Schmidt decomposition.
We are always happy to provide additional context/insight where appropriate, No need to apologize!
Re:
Discrete_generators
... yes, I would have assumed it was implemented, but didn't dig past documentation. Looks like it is (per Daniel's comment below)! Thanks for your patience.I would recommend trying Daniel's fix for discrete generators, which should enforce exactly the parity you're looking for.
j
is NumPy's representation for complex numerical objects (imaginary unit). Here's NumPy's documentation onnp.imag
with some examples involving.Thanks for providing us with some additional context into your issue. For your questions involving mutual information, would you mind posting a new issue? This helps us with tracking/metrics, etc..
Thank you for the help, Matt!
I don't mind it at all. A new discussion with a different header will also make it easier for others to search.
Hi Jared,
the discrete generator has to be a list of strings in your parameter
dictionary, in your case with one entry as you stated from the
04_SpinlessFermions.py example. Somewhere you have the class for the
operators which has also the basic features of a dictionary. Can you try
something like this:
Operators['symm_gen'] = np.fmod(Operators['nftotal'],2)
and then later
'Discrete_generators' : ['symm_gen']
Please let us know if that works as a solution.
Best regards,
Daniel
On Sun, Oct 25, 2020 at 8:23 PM Jared Bland jaredbland@users.sourceforge.net wrote:
Thanks, Daniel. I'll make an action item to update the documentation for OpenMPS on
Discrete_generators
(here) to reflect this.Thank you, Daniel.
When I try that, by adding
before the generating the parameters and just
inside the parameters definition, I get an error that the chemical potential term that I defined is not injective. I get the same error when I try to specify
Discrete_quantum_numbers : [0]
for the initial state inside the parameters definition.Should I try the if-then method you implemented in the openBH_correct_initial_state.py file on this page: https://sourceforge.net/p/openmps/discussion/users/thread/98b4aa4a5e/?limit=25#94eb/e0f8 ?
Is there any reason that a symmetry generator would make an otherwise properly working operator not injective? I've attached an attempt to add the discrete symmetry generator alla Daniel's method in the Bose Hubbard model linked in my previous reply.
The only other example I found is in a two flavored model here: https://sourceforge.net/p/openmps/discussion/tech/thread/134fa04f/?limit=25#903a
There Rafael has a two species Fermi Hubbard model, which seems to not be functioning correction from the replies given by Matthew on my other thread.