Skip to content

Instantly share code, notes, and snippets.

@manvillej
Created November 17, 2018 04:36
Show Gist options
  • Save manvillej/ee9e05ad98eb747b8ac4fdb473286767 to your computer and use it in GitHub Desktop.
Save manvillej/ee9e05ad98eb747b8ac4fdb473286767 to your computer and use it in GitHub Desktop.
use this function to calculate the resulting matrix from raising matrix to the 2^baseTwoTurns power.
def getBaseTwoTurnsMatrix(matrix, baseTwoTurns):
"""
use this function to calculate the resulting matrix from raising matrix to the 2^baseTwoTurns power.
"""
for _ in range(baseTwoTurns):
matrix = matrix*matrix
return matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment