Talk:Generator preimage: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Sintel (talk | contribs)
No edit summary
Sintel (talk | contribs)
No edit summary
Line 18: Line 18:
:* By calculating R = V[i] * S, we are basically calculating the number of steps V[i] maps each comma of S to.
:* By calculating R = V[i] * S, we are basically calculating the number of steps V[i] maps each comma of S to.
:* Build the block matrix [R | S] (prepending R to S)
:* Build the block matrix [R | S] (prepending R to S)
:* If we do some row operations or [R | S], it stays valid. Say we multiply it by an arbitrary unimodular matrix U:<br>[R' | S'] = U*[R | S] = [U*R | U*S]<br>This is true because R = V[i]*S, so U*R = U*V[i]*S = V[i]*U*S<br>=> R' = V[i]*S'<br>
:* If we do some row operations on [R | S], it stays valid. Say we multiply it by an arbitrary unimodular matrix U:<br>[R' | S'] = U*[R | S] = [U*R | U*S]<br>This is true because R = V[i]*S, so U*R = U*V[i]*S = V[i]*U*S<br>=> R' = V[i]*S'<br>
:* Since we want V[i]*u = 1, we want to find some U so that R' = [1,0,..,0]. This is exactly what the HNF does. The first row of S' is then the vector u we are after.
:* Since we want V[i]*u = 1, we want to find some U so that R' = [1,0,..,0]. This is exactly what the HNF does. The first row of S' is then the vector u we are after.
: I have left out some details and matrix transposes. Hopefully this helps clear things up.
: I have left out some details and matrix transposes. Hopefully this helps clear things up.
:-[[User:Sintel|Sintel]] ([[User talk:Sintel|talk]]) 00:51, 18 December 2021 (UTC)
:-[[User:Sintel|Sintel]] ([[User talk:Sintel|talk]]) 00:51, 18 December 2021 (UTC)

Revision as of 01:19, 18 December 2021

This page also contains archived Wikispaces discussion.

can anyone explain why the algorithm works?

I'm the person who added the "example" section as well as the "Wolfram Language implementation" there, so I understand how to do it, but I have no real idea why it works.

It's clear enough to me that the pseudoinverse step is how we convert the input mapping into generators. But then how do we "massage" those generators by combining them one at a time with the comma basis, defactoring, dot-producting with the original row to get a thing we prepend before HNF'ing so that it has some effect on what remains when we grab that row back out...? It's quite tricksy.

--Cmloegcmluin (talk) 18:04, 6 October 2021 (UTC)

Here's how it works:
  • We want to find u such that V*u = [0, ..., 0, 1, 0, ..., 0] where the 1 is on the i-th index.
  • Let's split up the problem:
    • V[i]*u = 1
    • V[no_i]*u = [0, 0, ..., 0] (where V[no i] is V with the i-th row deleted)
  • First calculate S. this is a kernel/comma basis for V[no_i].
  • The vector we want to find is in the rowspace of S. (aka it is a linear combination of its rows.)
    This is because V[no i]*u = [0, 0, ... , 0] <=> u is in the kernel of V[no_i].
  • By calculating R = V[i] * S, we are basically calculating the number of steps V[i] maps each comma of S to.
  • Build the block matrix [R | S] (prepending R to S)
  • If we do some row operations on [R | S], it stays valid. Say we multiply it by an arbitrary unimodular matrix U:
    [R' | S'] = U*[R | S] = [U*R | U*S]
    This is true because R = V[i]*S, so U*R = U*V[i]*S = V[i]*U*S
    => R' = V[i]*S'
  • Since we want V[i]*u = 1, we want to find some U so that R' = [1,0,..,0]. This is exactly what the HNF does. The first row of S' is then the vector u we are after.
I have left out some details and matrix transposes. Hopefully this helps clear things up.
-Sintel (talk) 00:51, 18 December 2021 (UTC)