Fixed get generalized indices

This commit is contained in:
vbuterin 2019-08-02 09:45:26 -04:00 committed by GitHub
parent 59307d1380
commit c6cdec8217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ def concat_generalized_indices(*indices: Sequence[GeneralizedIndex]) -> Generali
""" """
o = GeneralizedIndex(1) o = GeneralizedIndex(1)
for i in indices: for i in indices:
o = o * get_previous_power_of_2(i) + i o = o * get_previous_power_of_2(i) + (i - get_previous_power_of_2(i))
return o return o
``` ```