---
title: "Spacekime Analytics (Time Complexity and Inferential Uncertainty)"
subtitle: "Coordinate Transformations, Covariance, Contravariance, and Invariance"
author: "SOCR Team (Ivo Dinov)"
date: "`r format(Sys.time(),'%m/%d/%Y')`"
output: 
  html_document:
    theme: spacelab
    highlight: tango
    includes:
      before_body: TCIU_header.html
    toc: true
    number_sections: true
    toc_depth: 2
    toc_float:
      collapsed: false
      smooth_scroll: true
    code_folding: hide
---


```{r setup, include=FALSE, echo=FALSE}
knitr::opts_chunk$set(echo = TRUE, warings = FALSE, error = TRUE)
```

# Coordinate Transformations

Given complex vector space $V$, the set of all linear functions $L:V\to \mathbb{C}$ forms the dual space to $V$, which is also a vector space denoted by $V^*$. When $V$ is finite dimensional, $V^*$ has the same dimension as $V$. The pairing of vector spaces to their duals requires disambiguation of elements in $V$, called *contravariant vectors or kets*, and operatorsin $V^*$, called *dual vectors, covectors, covariant vectors, or bras*.

*Covariant components* transform synergistically (“co”) in the same way as the basis vectors, whereas *contravariant components* transform anti-synergistically (“contra”) in the opposite way to basis vectors. *Transformation of basis vectors* refers to mapping of the basis vectors in the original coordinate system into new basis vectors. *Transformation of vector components* refers to the change in the vector components (coefficients) relative to two different sets of coordinate axes.

$$\underbrace{(New\ basis\ vectors,\ ν')=(Transform\ matrix,\ T)\times 
(Original\ basis\ vectors,\ ν)}_{base\ vectors\ covary}\ ,$$

$$\underbrace{(Vector\ components\ in\ the\ new\ coordinate\ system,\ u_{ν'})=\\
(Inverse\ Transpose\ Transform\ matrix,\ (T^t)^{-1})\times 
(vector\ components\ in\ the\ original\ coordinate\ system,\ u_ν}_{base\ vectors\ covary}\ ,$$

Denote the new basis vector $v' = \begin{pmatrix} v_{1}' \\ v_{2}' \end{pmatrix}$, and the original basis vectors $v = \begin{pmatrix} v_{1} \\ v_{2} \end{pmatrix}$.
Denote the vector components in the new coordinate system $u_{v^\prime} = \begin{pmatrix} u^{1\prime} \\ u^{2\prime} \end{pmatrix}$, and the vector in the old coordinate system $u_v = \begin{pmatrix} u^{1} \\ u^{2} \end{pmatrix}$.

Any given (fixed) vector $\alpha\in \mathbb{R}^2$ would have unique representations 
in either the new ($v'$) or the old ($v$) coordinate systems

$$\alpha \equiv  \left \langle \begin{pmatrix} u^{1\prime}\\u^{2\prime} \end{pmatrix} | \begin{pmatrix} v_{1}^\prime \\ v_{2}^\prime \end{pmatrix} \right \rangle
= \underbrace{\begin{pmatrix} u^{1\prime} & u^{2\prime} \end{pmatrix}}_{new\ components}
\begin{pmatrix} v_{1}^\prime \\ v_{2}^\prime \end{pmatrix} \equiv
\begin{pmatrix} u^{1} & u^{2} \end{pmatrix}
\underbrace{\begin{pmatrix} v_{1} \\ v_{2} \end{pmatrix}}_{old\ basis}\ .$$

Then, there exists a *linear mapping* $T$ transforming the old basis into the new
basis, $T:v\to v'$,
$$\underbrace{\begin{pmatrix} v_1' \\ v_2' \end{pmatrix}}_{v'} = T
\underbrace{\begin{pmatrix} v_1 \\ v_2 \end{pmatrix}}_{v}\ .$$

$$\alpha = \left \langle \begin{pmatrix} u^{1\prime}\\u^{2\prime} \end{pmatrix} | \begin{pmatrix} v_{1}^\prime \\ v_{2}^\prime \end{pmatrix} \right \rangle = 
\left \langle\begin{pmatrix} u^{1\prime}\\u^{2\prime} \end{pmatrix} |\  T \begin{pmatrix} v_{1} \\ v_{2} \end{pmatrix}\right \rangle = 
\left \langle T^t \begin{pmatrix} u^{1\prime}\\u^{2\prime} \end{pmatrix} | \begin{pmatrix} v_{1} \\ v_{2} \end{pmatrix}\right \rangle = 
\left \langle\begin{pmatrix} u^{1}\\u^{2} \end{pmatrix} | \begin{pmatrix} v_{1} \\ v_{2} \end{pmatrix}\right \rangle\ .$$

Due to the uniqueness of the coordinate components, $u_{v} = \begin{pmatrix} u^{1} \\ u^{2} \end{pmatrix}$ and $u_{v^\prime} = \begin{pmatrix} u^{1\prime} \\ u^{2\prime} \end{pmatrix}$,

$$\underbrace{\begin{pmatrix} u^{1}\\u^{2} \end{pmatrix}}_{u_{v}} = T^t
\underbrace{\begin{pmatrix} u^{1\prime}\\u^{2\prime} \end{pmatrix}}_{u_{v'}}\ .$$

The transposed basis transformation matrix
$$T^t = \begin{bmatrix} T_{1}^{1} & T_{2}^{1} \\ T_{1}^{2} & T_{2}^{2} 
\end{bmatrix}$$
may be used to map the coefficient *components* of the vector $\alpha = u^1v_1 + u^2v_2$ from the old coordinate system, $v$, to components in the new basis, $v^\prime$:

$$u_v = T^tu_{v\prime}\ \   \Longleftrightarrow \ \ u_{v^\prime} = \left(T^t\right)^{-1}u_v\ .$$

# Example

Here is one example of a change of basis transformation
$$\left| \begin{array}{cc} 
v_1' = v_1 + 2 v_2 \\ v_2' = v_1 + 3 v_2  \end{array} \right.\ .$$

$$T\equiv \begin{pmatrix} T_1^1 & T_1^2 \\  T_2^1 & T_2^2 \end{pmatrix}=
\begin{pmatrix} 1 & 2 \\  1 & 3 \end{pmatrix}\ , \ \ 
T^{-1} = \begin{pmatrix} 3 & -2 \\  -1 & 1 \end{pmatrix}\ ,$$

$$T^t\equiv \begin{pmatrix} T_1^1 & T_2^1 \\  T_1^2 & T_2^2 \end{pmatrix}=
\begin{pmatrix} 1 & 1 \\  2 & 3 \end{pmatrix}\ , \ \ 
(T^t)^{-1} = \begin{pmatrix} 3 & -1 \\  -2 & 1 \end{pmatrix}\ ,$$

$$ν'=Tν\ \  , \ \  v=T^{-1}v' \ .$$

Suppose the vector $u_ν=u^1 ν_1+u^2 ν_2$ in the old system and in the new 
coordinate system, $u_{ν'} = u_{ν'}^1 ν_1' + u_{ν'}^2 ν_2'$. then,

$$u_ν=u^1 ν_1+u^2 ν_2 = \left\langle \begin{pmatrix} u^1 \\ u^2 \end{pmatrix} |
\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} \right\rangle= 
u^1 (3ν_1' - 2ν_2') + u^2 (-ν_1' + ν_2')=\cdots =\\ 
\underbrace{(3u^1-u^2)}_{u_{ν'}^1} ν_1' + 
\underbrace{(-2u^1 + u^2)}_{u_{ν'}^2} v_2' = u_{ν'}\ .$$ 



<!--html_preserve-->
<div>
    	<footer><center>
			<a href="https://www.socr.umich.edu/">SOCR Resource</a>
				Visitor number <img class="statcounter" src="https://c.statcounter.com/5714596/0/038e9ac4/0/" alt="Web Analytics" align="middle" border="0">
				<script type="text/javascript">
					var d = new Date();
					document.write(" | " + d.getFullYear() + " | ");
				</script> 
				<a href="https://socr.umich.edu/img/SOCR_Email.png"><img alt="SOCR Email"
	 			title="SOCR Email" src="https://socr.umich.edu/img/SOCR_Email.png"
	 			style="border: 0px solid ;"></a>
	 		 </center>
	 	</footer>

	<!-- Start of StatCounter Code -->
		<script type="text/javascript">
			var sc_project=5714596; 
			var sc_invisible=1; 
			var sc_partition=71; 
			var sc_click_stat=1; 
			var sc_security="038e9ac4"; 
		</script>
		
		<script type="text/javascript" src="https://www.statcounter.com/counter/counter.js"></script>
	<!-- End of StatCounter Code -->
	
	<!-- GoogleAnalytics -->
		<script src="https://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
		<script type="text/javascript"> _uacct = "UA-676559-1"; urchinTracker(); </script>
	<!-- End of GoogleAnalytics Code -->
</div>
<!--/html_preserve-->

