Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow indexing arrays with states #49

Merged
merged 9 commits into from Jan 25, 2021
Merged

Allow indexing arrays with states #49

merged 9 commits into from Jan 25, 2021

Conversation

lpawela
Copy link
Member

@lpawela lpawela commented Jan 18, 2021

This allows us to index arrays with states, eg

σ = (1, -1, -1, 1, 1)
d = 2^length(σ)
x = rand(2, 2, d)
@state x[1, 1, σ] # == x[1, 1, 20]

@lpawela lpawela marked this pull request as draft January 18, 2021 11:10
@kdomino
Copy link
Collaborator

kdomino commented Jan 18, 2021

But how does it comply with the (low) energy spectrum, where we can not map: (-1, .., -1, -1) -> 1, (-1, .., -1, 1) -> 2 etc ...

@bartekGardas
Copy link
Collaborator

I do not understand @kdomino objection. Can you please elaborate a bit more? The 1-1 mapping do exist, and hence it can be used to establish "state numbering".

@kdomino
Copy link
Collaborator

kdomino commented Jan 18, 2021

In the low energy spectrum you sort states by energies, hence indexing is energy dependent this is mode 5, am I right?
In modes 1-4 you may number (sub)states as you wish, i.e. either using subspace of the energy spectrum or simple mapping (-1, .., -1,-1) -> 1; (-1, ..., -1, 1) -> etc .... Nevertheless It must be consistent, i.e. in PEPS building and in setting particular index value.

@kdomino
Copy link
Collaborator

kdomino commented Jan 18, 2021

Non working example is in branch kd/indexing-tests benchmarks/indexing_example.jl

@kdomino
Copy link
Collaborator

kdomino commented Jan 18, 2021

@bartekGardas
Copy link
Collaborator

update_cells!(
g_ising,
rule = square_lattice((m, 1, n, 1, t)),
)

@lpawela lpawela marked this pull request as ready for review January 20, 2021 13:24
@lpawela lpawela changed the title [WIP] Allow indexing arrays with states Allow indexing arrays with states Jan 24, 2021
@bartekGardas
Copy link
Collaborator

It should work for now. Let's add some examples, especially for comparison with the Gibbs state.

Copy link
Collaborator

@bartekGardas bartekGardas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge as is, it should work for now.

@lpawela lpawela merged commit 49a38ac into master Jan 25, 2021
@lpawela lpawela deleted the lp/indexing branch January 25, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants