I have several (rather basic) questions on matrix representation of circuits and I would be very grateful to anyone that could clear up my confusion, thank you in advance.
1) When reading circuit diagrams I know that the input qubit goes in the left hand side. So If we are reading a circuit and it's gates go in the order a,b,c does that mean when we want to write out its matrix representation we multiply the matrices in the order c,a,b . For example if we have a circuit which consists of a swap gate followed by a Hadamard gate on the second qubit , followed by a Hadamard gate on the first qubit , then to calculate it's matrix representation we would have to calculate it in the order $(H_1\otimes I)(I\otimes H_2)Swap$, correct ? (as this reflects the order of application of gates on the qubit state).
2)If we are given a gate $S=\begin{pmatrix}1 &0 \\0 &i \end{pmatrix}$, but it is on the top line of a two line circuit with a line connecting it to the second (In other words it's a control gate ), I know that the first qubit is the control and the second is the target but I'm unsure of how to write it , should it be $S=\begin{pmatrix}1 & 0 &0&0 \\ 0 &-i &0&0\\0&0&1&0\\0&0&0&-i \end{pmatrix}$,
or should it be
$ S=\begin{pmatrix}1 & 0 &0&0 \\ 0 &1 &0&0\\0&0&-i&0\\0&0&0&-i \end{pmatrix}$,