This method returns a type of Gate from the given data. Some specific Gates are constructed as follows:
InputGate is constructed with inputGate name, if name is a number then this gate is assumed to be constant.
i1 : declareVariable X o1 = X o1 : InputGate |
i2 : declareVariable Y o2 = Y o2 : InputGate |
i3 : inputGate 3 o3 = 3 o3 : InputGate |
SumGate is constructed with sumGate L, where L is a list of gates, or Gate + Gate.
i4 : X + 1 o4 = (X + 1) o4 : SumGate |
i5 : sumGate{X,Y} o5 = (X + Y) o5 : SumGate |
ProductGate is constructed with productGate L, where L is a list of gates, or Gate * Gate.
i6 : 2*Y o6 = (2 * Y) o6 : ProductGate |
i7 : productGate{X,-X,Y} o7 = (X * (-1 * X) * Y) o7 : ProductGate |
DivideGate is constructed with Gate / Gate.
i8 : X / Y X o8 = - Y o8 : DivideGate |
DetGate is constructed with detGate L, where L is a doubly-nested list of gates, or det A, where A is a GateMatrix.
i9 : detGate {{X, Y}, {-Y, X}} o9 = det| X Y | | (-1 * Y) X | o9 : DetGate |
i10 : det matrix{{Y, 1}, {-1, X}} o10 = det| Y 1 | | -1 X | o10 : DetGate |