This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## UKB Phenotypic Correlation Matrices | |
## | |
## Generates a phenotypic correlation matrix for all GWAS'ed | |
## traits, residualized for all GWAS covariates. Also outputs | |
## a matrix of pairwise N's. | |
## | |
## Created by Caitlin E Carey ([email protected]) | |
## | |
## Last updated 9/27/2019 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import * | |
from sympy.physics.quantum import TensorProduct | |
# composition is '*' | |
# monoidal product | |
def T(*args): | |
if len(args) == 0: return Matrix([[1]]) | |
elif len(args) == 1: return args[0] | |
else: return TensorProduct(*args) |