text:
This seminar in organized in collaboration with Tomoki Nakanishi and Osamu Iyama

Remark: for rooms, is the building of Graduate School of Mathematics and A is the building Science A.

## Forthcoming talks

2015/03/13 - 14:00 to 15:30 - 多-309 - Gustavo Jasso (Bonn): Higher Auslander-Reiten theory revisited. I will report on recent joint work with Kvamme and Raedschelders, where we recover basic results in higher Auslander-Reiten theory by exploiting the $d$-abelian structure of $d$-cluster-tilting subcategories. We also investigate the concept of morphisms determined by objects in this context. No familiarity with higher Auslander-Reiten theory will be assumed.

## Past talks

2013/06/11 - 13:00 - room 多-552 - Tomoki Nakanishi (Nagoya): Wonder of sine-Gordon $Y$-systems. The sine-Gordon $Y$-systems and the reduced sine-Gordon $Y$-systems were introduced by Tateo in the 90's in the study of the integrable deformation of conformal field theory by the thermodynamic Bethe ansatz method. The periodicity property and the dilogarithm identities concerning these $Y$-systems were conjectured by Tateo, and only a part of them have been proved so far. We formulate these $Y$-systems by the polygon realization of cluster algebras of types $A$ and $D$, and prove the conjectured periodicity and dilogarithm identities in full generality. As it turns out, there is a wonderful interplay among continued fractions, triangulations of polygons, cluster algebras, and $Y$-systems. This is a joint work with Salvatore Stella.
Slides of the talk (from the webpage of Tomoki Nakanishi).

2013/07/10 - 14:45 - room A-317 - Gustavo Jasso (Nagoya): Skewsymmetric cluster algebras and their categorifications. The aim of this talk is to give an introduction to cluster algebras and their interaction with representation theory of finite dimensional algebras. For this we will focus on the simpler class of skewsymmetric cluster algebras without coefficients, and briefly describe their categorification by $2$-Calabi-Yau triangulated categories with a cluster tilting objects.

2013/07/16 - 13:00 - room A-317 - Yann Palu (Amiens - France): Introduction to the Caldero-Chapoton map. The Caldero-Chapoton map is an important tool in the theory of categorification of cluster algebras. It gives an "explicit" formula for the cluster variables of a given cluster algebra in terms of the triangulated category which categorifies it. The talk will be an introduction, illustrated with examples, to the Caldero-Chapoton map for cluster categories and their Hom-finite generalisations.

2013/07/16 - 14:45 - room A-317 - Pierre-Guy Plamondon (Orsay - France): Cluster categories, $\mathbf{g}$-vectors, and exchange graphs I. These talks will be concerned with additive categorification of Fomin-Zelevinsky's cluster algebras. We will focus on the interpretation of mutation, $\mathbf{g}$-vectors, coefficients and exchange graphs inside some triangulated categories, and see how one can deduce informations on the corresponding notions inside cluster algebras.

2013/07/19 - 13:00 - room A-317 - Xueyu Luo (Nagoya): Ice quivers with potentials associated with triangulations and Cohen-Macaulay modules over orders. Given a triangulation of a polygon $P$ with $n$ vertices, we associate an ice quiver with potential such that the associated Jacobian algebra has the structure of a Gorenstein tiled $K[x]$-order $\Lambda$. Then we show that the stable category of the category of Cohen-Macaulay $\Lambda$-modules is equivalent to the cluster category $\mathscr{C}$ of Dynkin type $A_{n-3}$. It gives a natural interpretation of the usual indexation of cluster tilting objects of $\mathscr{C}$ by triangulations of $P$. Moreover, it extends naturally the triangulated categorification by $\mathscr{C}$ of the cluster algebra of type $A_{n-3}$ to an exact categorification by adding coefficients corresponding to the sides of $P$. Finally, we lift the previous equivalence of categories to an equivalence between the stable category of graded Cohen-Macaulay $\Lambda$-modules and the bounded derived category of modules over a quiver of type $A_{n-3}$.

2013/07/19 - 14:45 - room A-317 - Yann Palu (Amiens - France): Iyama-Yoshino reduction for cluster categories from surfaces. In order to show that cluster-tilting objects have a mutation theory which resemble that of the clusters in a cluster algebra, Iyama and Yoshino introduced a "reduction" for triangulated categories. This Iyama-Yoshino reduction turned out to be of paramount importance in the categorification of cluster algebras. This talk will serve as an illustration of Iyama-Yoshino reductions in the context of cluster categories associated with marked surfaces. We will also present somme applications to the mutation theory of rigid objects in these cluster categories.

2013/07/23 - 13:00 - room A-317 - Pierre-Guy Plamondon (Orsay - France): Cluster categories, $\mathbf{g}$-vectors, and exchange graphs II. These talks will be concerned with additive categorification of Fomin-Zelevinsky's cluster algebras. We will focus on the interpretation of mutation, $\mathbf{g}$-vectors, coefficients and exchange graphs inside some triangulated categories, and see how one can deduce informations on the corresponding notions inside cluster algebras.

2013/07/30 - 13:00 - room A-317 - Yuya Mizuno (Nagoya): Introduction to $\mathbf{g}$-vectors of support $\tau$-tilting modules.. In this talk, we give an introduction to $\mathbf{g}$-vectors (which is also called index) of support $\tau$-tilting modules. We explain basic properties of them and a deep connection of $\mathbf{g}$-vectors of cluster-tilting objects in a 2-CY triangulated category. Moreover, we study $\mathbf{g}$-vectors of support $\tau$-tilting modules over preprojective algebras of Dynkin type. We give an explicit description of them and show a relationship of chambers of the associated root system.

2013/08/01 - 13:00 - room A-332 - Yu Liu (Nagoya): Hearts of twin cotorsion pairs on exact categories. In the papers of Nakaoka, he introduced the notion of hearts of (twin) cotorsion pair on triangulated categories and showed that they have structures of (semi-)abelian categories. We study in this talk a twin cotorsion pair $(\mathscr{S},\mathscr{T}),(\mathscr{U},\mathscr{V})$ on an exact category $\mathscr{B}$ with enough projectives and injectives and introduce a notion of the heart. First we show that its heart is preabelian. Moreover we show the heart of a single cotorsion pair is abelian. These results are analog of Nakaoka's results in triangulated categories. We will also construct cohomological functors from the exact category to the hearts of cotorsion pairs on it.

2013/08/01 - 14:15 - room A-332 - Laurent Demonet (Nagoya): Positivity for cluster algebras. The aim of this talk is to report the recent work of Lee and Schiffler proving the positivity for skew-symmetric cluster algebras. Precisely speaking, any cluster variable can be expanded as a Laurent polynomial $$\sum_{\mathbf{i} \in \mathbb{Z}^n} a_\mathbf{i} \mathbf{x}^\mathbf{i}$$ where $\mathbf{x} = \{x_1, x_2, \dots, x_n\}$ is a given cluster and the $a_\mathbf{i}$ non-negative integer coefficients (finitely many of which are non-zero).
See the article on arXiv.

2014/04/08 - 13:00 - room A-317 - Tomoki Nakanishi (Nagoya): Signed mutations and singed pops in cluster algebras. We propose two kinds of extensions of mutations in cluster algebras. The first one is the signed mutation. As the name suggests, it is the mutation with sign, and if the sign coincides with the tropical sign, it is the ordinary mutation, but, if it does not, it is twisted by coefficients. The second one is the signed pop. This operation is defined only for a cluster algebra with surface realization, and it is defined for a puncture inside self-folded triangle. These operations naturally appeared in the study of the mutation of Stokes graphs in the exact WKB analysis, but there seems to be a possibility of application for representation theory as well. In this talk we focus on the cluster algebraic aspect of these operations.

2014/04/20 - 16:00 - room A-428 - Akishi Ikeda (Tokyo): $A$型箙に付随した$N$-Calabi-Yau圏の安定性条件の空間について.

2014/11/10 - 11:00 and 14:00 - room 多-552 - Takuma Aihara: Brauer graph algebras I. Reading seminar (mainly internal).

2014/11/17 - 10:30 - room 多-409 - Tomoki Nakanishi (Nagoya): Generalized cluster algebras (1): generalized mutations. Generalized cluster algebras were introduced by Chekhov and Shapiro recently. They are generalizations of ordinary cluster algebras by replacing the familiar binomial term in the exchange relation of cluster variables with the polynomial one. It was shown by Chekhov and Shapiro that this generalization preserves the Laurent property and also the finite-type classification. In this series of talks I will demonstrate that it preserves essentially every aspect of ordinary cluster algebras.
See the article on arXiv.

2014/12/01 - 13:00 - room 多-409 - Tomoki Nakanishi (Nagoya): Generalized cluster algebras (2): seed structure. See previous abstract.

2014/12/08 - 11:00 and 14:00 - room 多-552 - Takahide Adachi (Nagoya): Brauer graph algebras II. Reading seminar (mainly internal).

2015/01/16 - 13:00 - room 多-309 - Tomoki Nakanishi (Nagoya): Generalized cluster algebras (3): quantization. Generalized cluster algebras were introduced by Chekhov and Shapiro recently. They are generalizations of ordinary cluster algebras by replacing the familiar binomial term in the exchange relation of cluster variables with the polynomial one. It was shown by Chekhov and Shapiro that this generalization preserves the Laurent property and also the finite-type classification. In this series of talks I will demonstrate that it preserves essentially every aspect of ordinary cluster algebras.
See the article on arXiv.

2015/01/16 - 14:45 - room 多-309 - Bernard Leclerc (Caen - France): Quivers with relations associated with symmetrizable Cartan matrices. Let $C$ be a symetrizable generalized Cartan matrix. In a joint work with Geiss and Schröer we have associated with $C$ a class of finite-dimensional algebras $H=H(C,D,\Omega)$ defined by quivers with relations, and we have started to study their representation theory. In this talk I will explain how we can now generalize a classical theorem of Schofield, and give in terms of varieties of $H$-modules a geometric constrution of the enveloping algebra $U(\mathfrak{n})$ of the positive part of the symmetrizable Kac-Moody algebra associated with $C$.
See the article on arXiv.


text:
# Arbitrary lattice graph in 2D

My purpose is to generate a graph representing a lattice, where the vertices are essentially the lattice sites. This lattice has to be periodic. That means the opposite boundaries are identical.
MWE for a square lattice:

nx = 5;
ny = 5;
DistributeDefinitions[nx, ny];
mat = (# + Transpose[#]) &[
ArrayFlatten[
ParallelTable[
KroneckerDelta[Mod[xi + 1, nx, 1], xj] KroneckerDelta[yi, yj] +
KroneckerDelta[Mod[yi + 1, ny, 1], yj] KroneckerDelta[xi,
xj], {xi, nx}, {xj, nx}, {yi, ny}, {yj, ny}]]];

This essentially generates a periodic square lattice.
Now we can put a lattice site between two adjacent sites at one of the edges, which is shown in the below graph. To illustrate, there is 3 between 1 and 2, which was previously missing in the square lattice.
One can change this number from one to two, as shown below. Actually, this number can change, which I refer to as arbitrary (in the heading). Is there a single piece of code that can generate all of these kinds of lattices? Unfortunately, I have to write a single piece of code for each of them. Importantly, there are periodic boundaries shown with red along the $$y$$-axis and black along the $$. x$$-axis

NEW EDIT:
After useful comments from @flinty, @David and @kglr. My update MWE:

ClearAll[nx, ny, mat, gph, nv, edgeA, i, j, nv, edgeA];
{nx, ny} = {4, 4};
gph = AdjacencyGraph[mat, VertexLabels -> Automatic];

nv[g_, v_, k_] := VertexList[NeighborhoodGraph[g, v]][[k]];
edgeA[m_, g_, v_, k_] :=
g, {nv[g, v, 1] \[UndirectedEdge] Length[m] + 2 k + v^2 - 1,
Length[m] + 2 k + v^2 - 1 \[UndirectedEdge] nv[g, v, k + 1]}];
vertexA[m_, g_, v_, k_] :=
EdgeDelete[
edgeA[m, g, v, k], {nv[g, v, 1] \[UndirectedEdge] nv[g, v, k + 1]}];
checkA[m_, g_, v_, k_] :=
If[(v < Length[VertexList[NeighborhoodGraph[g, 1]]] - 1 \[And]
v == k) \[Or] (nv[g, v, 1] < nv[g, v, k + 1]),
vertexA[m, g, v, k], Nothing];

DistributeDefinitions[mat, gph, checkA, nv, edgeA];

ParallelTable[
checkA[mat, gph, i, j], {i, 1, Length[mat] - 1}, {j, 1,
Length[VertexList[NeighborhoodGraph[gph, 1]]] - 1}]

This actually generates a graph that has added vertex between each pair of adjacent vertices. However, this only generates a different graph, the idea is to update the original graph, and to equip it with these changes. Can we do this?

• Perhaps a double periodic lattice might be represented as a TorusGraph since both sides wrap around? e.g ResourceFunction["TorusGraph"][{10, 4}] Jul 1, 2021 at 18:08
• @flinty This might work for square type tilling but can we also do it for the one I showed in my questions by tweaking some parameters maybe? Jul 1, 2021 at 18:32
• I would start with @flinty's TorusGraph solution and then use AddEdge (in an iterated loop) to add edges along one of the component graph (circular) paths. Jul 1, 2021 at 23:57
• Step by step: g = Graph[{1 <-> 2, 2 <-> 3}, VertexLabels -> "Name"], EdgeDelete[g, 1 <-> 2],h = VertexAdd[g, 4],k = EdgeAdd[h, {1 <-> 4, 4 <-> 2}]. Hope this helps. Jul 2, 2021 at 17:21
• an aside: you can use Prepend[v]@AdjacencyList[g, v] instead of VertexList[NeighborhoodGraph[g, v]]
– kglr
Jul 6, 2021 at 2:44

We can add a second argument to TorusGraph to specify the number of segments between nodes with integer coordinates in each dimension:

ClearAll[torusGraph]
torusGraph[dims : {__Integer}, segs: {__Integer} : {1, 1},
opts : OptionsPattern[Graph]] := Module[{m = Length[dims], tg},
tg = Graph[Flatten[Array[Table[Rule @@@
Partition[Function[x, Mod[{##} + UnitVector[m, i] x, dims, 1]] /@
Subdivide[segs[[i]]], 2, 1], {i, m}] &, dims, 1]], opts,
DirectedEdges -> False];
IndexGraph @ Graph[Sort@VertexList[tg], EdgeList[tg],
VertexCoordinates -> ScalingTransform[{1, -1}][
RotationTransform[-Pi/2] @ Sort @ VertexList[tg]], opts,
VertexLabels -> "Index", EdgeShapeFunction -> "CurvedArc"]]

Examples:

Default number of segments between original sites is 1:

torusGraph[{4, 5}, ImageSize -> 400]

Add a node in the middle of horizontal edges:

torusGraph[{4, 5}, {1, 2}, ImageSize -> 400]

Add two nodes on horizontal and 1 node on vertical edges:

g0 = torusGraph[{4, 5}, {2, 3}, ImageSize -> 500]

HighlightGraph[g0,
VertexList[g0, _?(Nand @@ (IntegerQ /@ PropertyValue[{g0, #}, VertexCoordinates]) &)]]

Make the edges straight lines:

torusGraph[{4, 5}, {2, 3}, EdgeShapeFunction -> "Line", ImageSize -> 500]

Used curved edges to indicate periodic boundaries:

SetProperty[g0, EdgeShapeFunction ->
(If[ManhattanDistance @@ #[[{1, -1}]] > 1,
GraphElementData["CurvedArc"][##],
GraphElementData["Line"][##]] &)]

Use a custom EdgeShapeFunction to indicate periodic boundaries:

ClearAll[periodicEdges, eSF]
periodicEdges[off_: 50] := Module[{vc = Sort[#[[{1, -1}]]],
offset = off Unitize[Subtract @@ Sort[#[[{1, -1}]]]]},
Arrow[{vc[[1]], Offset[- offset, vc[[1]]]}],
Arrow[{vc[[2]], Offset[ offset, vc[[2]]]}]}] &

eSF = If[ManhattanDistance @@ #[[{1, -1}]] > 1, periodicEdges[][#],
GraphElementData["Line"][##]] &;

torusGraph[{4, 5}, EdgeShapeFunction -> eSF]

torusGraph[{4, 5}, {2, 3}, EdgeShapeFunction -> eSF, ImageSize -> 500]

• Billion thanks @kglr! You have fully answered the problem in its full glory :) Just a naive question, can we also implement, for instance, a hexagonal lattice and then add vertices similarly? Jul 6, 2021 at 14:05
• @Shamina, my pleasure. ResourceFunction[TorusGraph] was easy to modify to get the desired result. If you have a similar function that generates a hexagonal lattice it may be possible to modify it in a similar way.
– kglr
Jul 6, 2021 at 14:13
• @Shamina You can use IGraphM to generate a periodic triangular lattice (which gives you a hexagonal neighborhood). I suppose that then would be easy to apply the method by kglr. Jul 6, 2021 at 16:01
• If you want to simply add vertices as subdivisions along the hexagonal lattice vectors, then note that's the same as the rectangular lattice topology @kglr showed above - and then use the hexagonal lattice vectors to transform VertexCoordinates. Jul 6, 2021 at 16:11
• @Shamina, if you are content with the solutions, it is a good practice to accept them as "answered" if you haven't already Jul 6, 2021 at 18:56

## Edit 03

Here's a function to wrap all this up and answer the latest questions in the comments.
Some utility functions:

makePeriodicLattice2D[pts_, {sizeH_, sizeV_}] :=
With[{d = ArrayDepth[pts]},
Transpose[
Mod[#1, #2, -#2/2] &, {Transpose[pts,
RotateLeft[Range[d]]], {sizeH, sizeV}}],
RotateRight[Range[d]]]]
makePeriodicCartesian2D[pts_, {sizeH_, sizeV_}, latticeVectors_] :=
With[{inv = Inverse[latticeVectors]},
makePeriodicLattice2D[pts . inv, {sizeH, sizeV}] . latticeVectors]

periodicDistanceLatticePair[{x1_, x2_}, {sizeH_, sizeV_}] :=
With[{d = ArrayDepth[x1]},
Map[Norm,
makePeriodicLattice2D[
Outer[Subtract, x1, x2, 1], {sizeH, sizeV}], {d}]]
periodicDistanceCartesianPair[{x1_, x2_}, {sizeH_, sizeV_},
latticeVectors_] :=
With[{d = ArrayDepth[x1]},
Map[Norm,
makePeriodicCartesian2D[Outer[Subtract, x1, x2, 1], {sizeH, sizeV},
latticeVectors], {d}]]

Map[Boole[0 < # <= r] &, mat, {2}]

Main function:

periodicLatticeGraph[latticeVecs_,
motif_, {horizontalExtent_, verticalExtent_}, bondsMatrix_] :=
Block[{latt, pdm, gg},
latt = Tuples[{Range[-horizontalExtent, horizontalExtent - 1],
Range[-verticalExtent, verticalExtent - 1]}];
latt = # . latticeVecs & /@ Outer[Plus, motif, latt, 1];

pdm = ArrayFlatten[
2 {horizontalExtent, verticalExtent},
latticeVecs], #2] &, {Partition[Tuples[latt, 2],
Length[motif]], bondsMatrix}, 2]];
gg = AdjacencyGraph[pdm, VertexCoordinates -> Join @@ latt,
EdgeShapeFunction -> "CurvedArc"]]

and the rectangular example again with different horizontal/vertical extents and a curved EdgeShapeFunction to illustrate it's indeed periodic:

periodicLatticeGraph[
{{1, 0}, {0, 3/4}},
{{0, 0}, {1/3, 0}, {2/3, 0}},
{4, 2},
ReplacePart[ConstantArray[1/2, {3, 3}], {1, 1} -> 3/4]]

A hexagonal lattice with (2,1) subdivisions along the lattice vectors

periodicLatticeGraph[{{1/2,-Sqrt[3]/2},{1/2,Sqrt[3]/2}},N[{{0,0},{0,1/2},{1/3,0},{2/3,0}}],{3,3},ReplacePart[ConstantArray[0.1,{4,4}],{{1,2},{2,1},{1,3},{3,1},{1,4},{4,1},{3,4},{4,3}}->0.5]]

and just for fun, a graphene (honeycomb) lattice:

periodicLatticeGraph[{{1/2,-Sqrt[3]/2},{1/2,Sqrt[3]/2}},N[{{0,0},{1/3,2/3}}],{3,3},ReplacePart[ConstantArray[1/Sqrt[2],{2,2}],{1,1}->0.1]]

## Edit 02

Perhaps what you're looking for can be achieved using a lattice motif and a block periodic distance matrix (think of it like making a crystal lattice with different types of atoms and then specifying different 'bond lengths'). Here's an example:

First, let's change the periodicDistance functions to accept two sets of lattice points:

periodicDistanceLatticePair[{x1_, x2_}, size_] :=
With[{d = ArrayDepth[x1]},
Map[Norm,
makePeriodicLattice[Outer[Subtract, x1, x2, 1], size], {d}]]
periodicDistanceCartesianPair[{x1_, x2_}, size_, latticeVectors_] :=
With[{d = ArrayDepth[x1]},
Map[Norm,
makePeriodicCartesian[Outer[Subtract, x1, x2, 1], size,
latticeVectors], {d}]]

make a lattice using the motif ((0,0),(1/2,0))

latticeVectors["rect"]=latticeConstant{{1,0},{0,3/4}};
motif["rect"]={{0,0},{1/2,0}};
lattice["rect"]=#.latticeVectors["rect"]&/@Outer[Plus,motif["rect"],lattice["rect"],1];

and then compute the periodic distance matrix block-wise, i.e. (top-left, A-A, bond-length 3/4 a), (top-right, A-B, bond-length 1/2 a), (bottom-left, B-A, bond-length 1/2 a), (bottom-right, B-B, bond-length 1/2 a), where A,B denote the different motif atoms and a is the lattice constant:

pdm["rect"]=ArrayFlatten[MapThread[linked[periodicDistanceCartesianPair[#1,2 latticeRadius,latticeVectors["rect"]],#2]&,{Partition[Tuples[lattice["rect"],2],2],latticeConstant{{3/4,1/2},{1/2,1/2}}},2]];
VertexDegree[gg["rect"]]//Tally
HighlightGraph[gg["rect"],NeighborhoodGraph[gg["rect"],Position[Join@@lattice["rect"],{1/2,0}][[1,1]]]]

{{4, 36}, {2, 36}}

## Edit 01

In response to a comment about identifying nearest-neighbors not based on cartesian distance, I realized it's actually much simpler to construct the adjacency graph in the lattice domain.

E.g. for a rectangular lattice:

latticeVectors["rect"]=latticeConstant{{1,0},{0,1/4}};
VertexDegree[gg["rect"]]//Tally
HighlightGraph[gg["rect"],NeighborhoodGraph[gg["rect"],Position[lattice["rect"],{2,0}][[1,1]]]]

{{4,36}}

## Original Post

Not sure I understood your question correctly, especially the part about adding vertices along edges to augment the lattice.

However, the following builds arbitrary periodic lattice graphs in n dimensions (well, at-least 2 and 3). Tested with primitive unit cells (i.e. one atom per unit-cell), but should be easy to extend to a lattice with a motif.

The idea is to generate a lattice of points, and then compute the adjacency matrix of the graph using a periodic distance matrix. I suspect there's many ways to do this, here I just using Mod in the regular lattice domain and then transform back to the cartesian domain.

makePeriodicLattice[pts_, size_] := Mod[pts, size, -size/2 ]
makePeriodicCartesian[pts_, size_, latticeVectors_] :=
With[{inv = Inverse[latticeVectors]},
Mod[pts . inv, size, -size/2 ] . latticeVectors]

periodicDistanceLattice[x_, size_] :=
With[{d = ArrayDepth[x]},
Map[Norm,
makePeriodicLattice[Outer[Subtract, x, x, 1], size], {d}]]
periodicDistanceCartesian[x_, size_, latticeVectors_] :=
With[{d = ArrayDepth[x]},
Map[Norm,
makePeriodicCartesian[Outer[Subtract, x, x, 1], size,
latticeVectors], {d}]]

Finally, let's define some utility functions and constants to make the adjacency graph:

linked[mat_?MatrixQ, r_?Positive] := Map[Boole[0 < # <= r] &, mat, {2}]
latticeConstant = 1;

## Examples

### Hexagonal Lattice (2D)

latticeVectors["hexagonal"]=latticeConstant{{1/2,-Sqrt[3]/2},{1/2,Sqrt[3]/2}};
VertexDegree[gg["hexagonal"]]//Tally
HighlightGraph[gg["hexagonal"],NeighborhoodGraph[gg["hexagonal"],Position[lattice["hexagonal"],{0,0}][[1,1]]]]

(*{{6,36}}*)

### Square Lattice (2D)

latticeVectors["square"]=latticeConstant{{1,0},{0,1}};
VertexDegree[gg["square"]]//Tally
HighlightGraph[gg["square"],NeighborhoodGraph[gg["square"],Position[lattice["square"],{0,0}][[1,1]]]]

(*{{4,36}}*)

### Face-Centered Cubic Lattice (3D)

latticeVectors["FCC"]=latticeConstant{{0,1/2,1/2},{1/2,0,1/2},{1/2,1/2,0}};

(*{{12,216}}*)
• If I understand the OP, you're close, but you still have vertex spacing of $1$ in each direction. The OP wants (for example) $5$ vertices linked horizontally for each $1$ link vertically.... not square. Jul 2, 2021 at 18:08
• Your edit looks excellent! Is there a way to change the number of added vertices in the horizontal section? For e.g., now you have one extra, can we have two, three, four, etc. Also can we have a periodic boundary condition for the gg["rect"]? (in edit 3). Many thanks!! Jul 6, 2021 at 12:15
• @Shamina have a look at the new edit - The number of in-between vertices (or any other arrangement of vertices really) is controlled by the motif argument above. This is expecting a list of (u,v) lattice coordinates for each vertex, whereby they'll get dotted with the lattice vectors (a,b) to give (x,y) = (u,v).(a,b). In your case we can use something as simple as Thread[{Most[Subdivide[3]], 0}] for two subdivisions. Jul 6, 2021 at 13:08

format: plain


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# 4.12: Integer Division

Difficulty Level: At Grade Created by: CK-12
Estimated5 minsto complete
%
Progress
Practice Integer Division

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated5 minsto complete
%
Estimated5 minsto complete
%
MEMORY METER
This indicates how strong in your memory this concept is

Cameron and his new diving partner Gina are going to be buddies on a 40 foot dive. Gina is a new diver and is still learning to make a descent. Cameron can make a free descent quite easily. This means that he doesn’t hold onto anything as he descends to the appropriate depth. Gina will hold onto the anchor line. Then they will meet on the bottom.

Cameron has decided to slow down his descent and to go down with Gina. He will do his free descent next to her descent holding onto the rope. He looks at his watch and sets the timer before they descend.

When they reach the bottom, Cameron looks at his watch. He sees that the descent took them 2 minutes. Not bad at all considering that Gina is a beginner. Cameron and Gina meet up with the group and check in with the Dive Master. Then they are off for a beautiful dive!!

How far did Cameron and Gina descend per minute?

To answer this question, you will need to understand how to divide integers. Pay attention and you will be able to answer these questions at the end of the Concept.

### Guidance

Another important step in learning how to compute with integers is learning how to divide them. You can look for patterns in a sequence of quotients just as you looked for patterns in a sequence of products in an earlier lesson. These patterns will help you to understand the rules for dividing integers.

Let’s look at some integer patterns with division. We are looking at quotients. A quotient is the answer in a division problem.

Use a pattern to find the missing quotients below.

6÷24÷22÷20÷22÷24÷2=3=2=1=0=?=?\begin{align*}6 \div 2 & = 3\\ 4 \div 2 & = 2\\ 2 \div 2 & = 1\\ 0 \div 2 & = 0\\ -2 \div 2 & = ?\\ -4 \div 2 & = ?\\\end{align*}

Look for a pattern among the quotients. Remember that a pattern has a rule that makes it repeat in a certain way. Look at the pattern below.

This pattern uses shapes and not numbers, but there is still a rule that has it happen the way that it does.

Now look at the number pattern.

You will see that you can subtract 1 from the previous quotient to find the next quotient. Remember, subtracting 1 is the same thing as adding its opposite, -1. Try adding -1 to the previous quotients to find the next quotients.

To find the quotient of 2÷2\begin{align*}-2 \div 2\end{align*}, add 0+(1)\begin{align*}0+(-1)\end{align*}

|0|=0\begin{align*}|0|=0\end{align*} and |1|=1\begin{align*}|-1|=1\end{align*}, so subtract the lesser absolute value from the greater absolute value.

10=1\begin{align*}1-0=1\end{align*}

The integer with the greater absolute value is -1, so give the answer a negative sign.

0+(1)=1\begin{align*}0+(-1)=-1\end{align*}, so 2÷2=1\begin{align*}-2 \div 2=-1\end{align*}

To find the quotient of 4÷2\begin{align*}-4 \div 2\end{align*}, add 1+(1)\begin{align*}-1+(-1)\end{align*}

Both integers have the same sign, so add their absolute values.

|1|=1\begin{align*}|-1|=1\end{align*}, so add

1+1=2\begin{align*}1+1=2\end{align*}

Give that answer a negative sign.

1+(1)=2\begin{align*}-1+(-1)=-2\end{align*}, so \begin{align*}-4 \div 2 =-2\end{align*}.

This shows the completed division facts.

\begin{align*}6 \div 2 & = 3\\ 4 \div 2 & = 2\\ 2 \div 2 & = 1\\ 0 \div 2 & = 0\\ -2 \div 2 & = -1\\ -4 \div 2 & = -2\\\end{align*}

Each quotient is still 1 less than the previous quotient.

What conclusions can we draw from this pattern?

You may notice the following.

• When a positive integer is divided by a positive integer, 2, the quotient is positive.
• When zero is divided by a positive integer, 2, the quotient is zero.
• When a negative integer is divided by a positive integer, 2, the quotient is negative.

These are the beginnings of our rules for dividing integers.

Let’s look at another pattern to complete these rules.

Look at the number facts below. Analyze the pattern of quotients shown.

\begin{align*}&9 \div (-3) = -3\\ &6 \div (-2) = -3\\ &3 \div (-1) = -3\\ &0 \div 0 = undefined\\ &-3 \div (-1) = 3\\ &-6 \div (-2) = 3\\ &-9 \div (-3) = 3\end{align*}

What do you notice about these facts?

You may notice the following rules.

• When a positive integer is divided by a negative integer, the quotient is negative.
• When zero is divided by zero, the quotient is undefined, not zero. (Note: Any number divided by zero is considered undefined.)
• When a negative integer is divided by a negative integer, the quotient is positive.

Now we can use these rules to divide integers. Just like with the rules for multiplying, becoming great at dividing integers will require that you memorize these rules.

Next, let’s apply these rules to dividing integers.

Find the quotient \begin{align*}(-33) \div (-3)\end{align*}

To find this quotient, we need to divide two negative integers.

Divide the integers without paying attention to their signs. The quotient will be positive.

\begin{align*}(-33) \div (-3) = 33 \div 3 = 11\end{align*}

The quotient is 11.

Find the quotient \begin{align*}(-20) \div 5\end{align*}.

To find this quotient, we need to divide two integers with different signs.

Divide the integers without paying attention to their signs. Give the quotient a negative sign.

\begin{align*}20 \div 5 =4\end{align*}, so \begin{align*}(-20) \div 5 = -4\end{align*}.

The quotient is -4.

These problems used a division sign, but remember we can also show division using a fraction bar where the numerator is divided by the denominator.

Now, it’s time for you to practice applying these rules while figuring out quotients.

#### Example A

\begin{align*}-12 \div -3\end{align*}

Solution: \begin{align*}4\end{align*}

#### Example B

\begin{align*}\frac{18}{-3}\end{align*}

Solution: \begin{align*}-6\end{align*}

#### Example C

\begin{align*}-24 \div 8\end{align*}

Solution: \begin{align*}-3\end{align*}

Here is the original problem once again.

Cameron and his new diving partner Gina are going to be buddies on a 40 foot dive. Gina is a new diver and is still learning to make a descent. Cameron can make a free descent quite easily. This means that he doesn’t hold onto anything as he descends to the appropriate depth. Gina will hold onto the anchor line. Then they will meet on the bottom.

Cameron has decided to slow down his descent and to go down with Gina. He will do his free descent next to her descent holding onto the rope. He looks at his watch and sets the timer before they descend.

When they reach the bottom, Cameron looks at his watch. He sees that the descent took them 2 minutes. Not bad at all considering that Gina is a beginner. Cameron and Gina meet up with the group and check in with the Dive Master. Then they are off for a beautiful dive!!

How far did Cameron and Gina descend per minute?

First, we need to write integers to represent the depth and the time.

-40 feet is the depth

2 minutes is the time

We dive the depth by the time to find out the number of feet per minute.

\begin{align*}-40 \div 2 = -20\end{align*}

Cameron and Gina traveled -20 feet per minute.

### Vocabulary

Here are the vocabulary words in this Concept.

Quotient
the answer in a division problem.
Undefined
when an integer is divided by 0, the answer of that is undefined.

### Guided Practice

Here is one for you to try on your own.

On 3 consecutive plays, a football team lost a total of 30 yards. The team lost the same number of yards on each play. Represent the number of yards lost on each play as a negative integer.

First, represent the total number of yards lost as an integer.

Since the integer shows a loss of 30 yards, use a negative integer -30.

To represent the loss for each of the 3 plays, divide the integer representing the total number of yards lost by 3.

We write this equation and then fill in the given values

Total yards lost \begin{align*}\div\end{align*} number of plays = yds lost on each play

\begin{align*}-30 \div 3 =?\end{align*}

To find this quotient, we need to divide two integers with different signs.

Divide the integers without paying attention to their signs. Give the quotient a negative sign.

\begin{align*}30 \div 3 = 10\end{align*}, so \begin{align*}(-30) \div 3 = -10\end{align*}.

The integer -10 represents the number of yards lost on each play.

### Video Review

Here is a video for review.

### Practice

Directions: Find each quotient.

1.\begin{align*}-18 \div 6\end{align*}

2. \begin{align*}-18 \div -6\end{align*}

3. \begin{align*}48 \div 8\end{align*}

4. \begin{align*}64 \div (-8)\end{align*}

5. \begin{align*}-28 \div (-4)\end{align*}

6. \begin{align*}-35 \div 7\end{align*}

7. \begin{align*}-80 \div (-4)\end{align*}

8. \begin{align*}-50 \div 10\end{align*}

9. \begin{align*}-18 \div -2\end{align*}

10. \begin{align*}42 \div -6\end{align*}

11. \begin{align*}-72 \div 9\end{align*}

12. \begin{align*}-48 \div -12\end{align*}

13. \begin{align*}-16 \div 4\end{align*}

14. \begin{align*}-22 \div -11\end{align*}

15. \begin{align*}72 \div -12\end{align*}

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

### Vocabulary Language: English

TermDefinition
Fraction Bar A fraction bar is a line used to divide the numerator and the denominator of a fraction. The fraction bar means division.
Integer The integers consist of all natural numbers, their opposites, and zero. Integers are numbers in the list ..., -3, -2, -1, 0, 1, 2, 3...
Inverse Operation Inverse operations are operations that "undo" each other. Multiplication is the inverse operation of division. Addition is the inverse operation of subtraction.
Quotient The quotient is the result after two amounts have been divided.

Show Hide Details
Description
Difficulty Level:
Authors:
Tags:
Subjects:


text:
# Triangle Law of Vector Addition of Two Vectors

## Triangle Law of Vector Addition of Two Vectors

The physical quantities may be broadly classified into the vectors and the scalars. The quantities with magnitude and direction both are known as vector quantities, it means a vector is a physical quantity that has both magnitude and direction. If two non-zero vectors are represented by the two sides of a triangle taken in same order then the resultant is given in opposite order.

i.e.., $$\overrightarrow{R}=\overrightarrow{A}+\overrightarrow{B}$$ $$\because \overrightarrow{OB}=\overrightarrow{OA}+\overrightarrow{AB}$$

1) Magnitude of Resultant Vector:  In ΔABN, $$\cos \theta =\frac{AN}{B}$$ ⇒ AN = B cos θ

$$\sin \theta =\frac{BN}{B}$$ ⇒ BN = B sinθ; ΔOBN, we have OB² = ON² + BN².

R² = (A + B cosθ)² + (B sinθ)²

R² = A² + B² cos²θ + 2 AB cosθ + B² sin² θ

R² = A² + B² (cos²θ + sin²θ) + 2AB cosθ = A² + B² (1) + 2 AB cosθ

$$R=\sqrt{{{A}^{2}}+{{B}^{2}}+2AB\cos \theta }$$.

2) Direction of resultant vectors: If θ is angle between $$\overrightarrow{A}$$ and $$\overrightarrow{B}$$, then

$$|\overrightarrow{A}+\overrightarrow{B}|\,=\,\sqrt{{{A}^{2}}+{{B}^{2}}+2AB\cos \theta }$$ ; If $$\overrightarrow{R}$$ makes an angle α with$$\overrightarrow{A}$$, then in ΔOBN,

$$\tan \alpha =\frac{BN}{ON}=\frac{BN}{OA+AN}=\frac{B\sin \theta }{A+B\cos \theta }$$.


text:
A chemist is making a solution that is to be 55% chlorine. He has one solution that is 40% chlorine and another that is 65% chlorine. He wants 100 liters of the final solution. How much of each should he mix?

Aug 11, 2015

You need to mix 40 L of 40% solution and 60 L of 65% solution.

Explanation:

You know that the volume of the final solution is 100 L. If $x$ represents the volume of the 40% solution and $y$ represents the volume of the 65% solution, then you can say that

$x + y = 100$

Now you need to focus on the chlorine content. Since the first solution is 40% chlorine, then for $x$ liters you would get

$\left(x\right) \text{cancel("L solution") * "40 g chlorine"/(100cancel("L solution")) = (0.4 * x)" g chlorine}$

The same can be said for the 65% solution

$\left(y\right) \text{cancel("L solution") * "65 g chlorine"/(100cancel("L solution")) = (0.65 * y)" g chlorine}$

The final solution has a percent concentration of 55% chlorine, which means that it must contain

$100 \text{cancel("L solution") * "55 g chlorine"/(100cancel("L solution")) = "55 g chlorine}$

The second equation you can write will thus relate the amount of chlorine each solution contributes to the final solution

$0.4 x + 0.65 y = 55$

This is your system of equations

$\left\{\begin{matrix}x + y = 100 \\ 0.4 x + 0.65 y = 55\end{matrix}\right.$

Use the first one to write $x$ as a function of $y$

$x = 100 - y$

Now use this expression in the second equation to get the value of $y$

$0.4 \cdot \left(100 - y\right) + 0.65 y = 55$

$40 - 0.4 y + 0.65 y = 55$

$0.25 y = 15 \implies y = \frac{15}{0.25} = \textcolor{g r e e n}{60}$

This means that $x$ is equal to

$x = 100 - 60 = \textcolor{g r e e n}{40}$

So, if you mix 40 L of a 40% chlorine solution with 60 L of a 65% chlorine solution you will get 100 L of a 55% chlorine solution.


text:
# Cross Product Calculator

The online calculator will find the cross product of two vectors, with steps shown.

$\langle$ $\rangle$
Comma-separated.
$\langle$ $\rangle$
Comma-separated.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Calculate $\left\langle 3, 1, 4\right\rangle\times \left\langle -2, 0, 5\right\rangle$.

## Solution

To find the cross product, we form a formal determinant the first row of which consists of unit vectors, the second row is our first vector, and the third row is our second vector: $\left|\begin{array}{ccc}\mathbf{\vec{i}} & \mathbf{\vec{j}} & \mathbf{\vec{k}}\\3 & 1 & 4\\-2 & 0 & 5\end{array}\right|$.

Now, just expand along the first row (for steps in finding a determinant, see determinant calculator):

$\left|\begin{array}{ccc}\mathbf{\vec{i}} & \mathbf{\vec{j}} & \mathbf{\vec{k}}\\3 & 1 & 4\\-2 & 0 & 5\end{array}\right| = \left|\begin{array}{cc}1 & 4\\0 & 5\end{array}\right| \mathbf{\vec{i}} - \left|\begin{array}{cc}3 & 4\\-2 & 5\end{array}\right| \mathbf{\vec{j}} + \left|\begin{array}{cc}3 & 1\\-2 & 0\end{array}\right| \mathbf{\vec{k}} = \left(\left(1\right)\cdot \left(5\right) - \left(4\right)\cdot \left(0\right)\right) \mathbf{\vec{i}} - \left(\left(3\right)\cdot \left(5\right) - \left(4\right)\cdot \left(-2\right)\right) \mathbf{\vec{j}} + \left(\left(3\right)\cdot \left(0\right) - \left(1\right)\cdot \left(-2\right)\right) \mathbf{\vec{k}} = 5 \mathbf{\vec{i}} - 23 \mathbf{\vec{j}} + 2 \mathbf{\vec{k}}$

Thus, $\left\langle 3, 1, 4\right\rangle\times \left\langle -2, 0, 5\right\rangle = \left\langle 5, -23, 2\right\rangle.$

$\left\langle 3, 1, 4\right\rangle\times \left\langle -2, 0, 5\right\rangle = \left\langle 5, -23, 2\right\rangle$A


text:
$$\DeclareMathOperator{\codim}{codim} \DeclareMathOperator{\reg}{reg}$$

Matthew Mastroeni

I am a Postdoc Research Associate in the Department of Mathematics at Iowa State University working in commutative algebra. I received my Ph.D. from the University of Illinois at Urbana-Champaign in 2018, where I was advised by Hal Schenck. Previously, I was a Postdoctoral Fellow at Oklahoma State University.

Contact Information

• Email: mmastro "at" iastate "dot" edu
• Office: 463 Carver Hall

Research

I am interested in computational and homological aspects of commutative algebra, especially the structure of free resolutions, Koszul algebras, linkage, and Rees algebras.

1. The InvariantRing package for Macaulay2
(with L. Ferraro, F. Galetto, F. Gandini, H. Huang, and X. Ni.) Submitted.
A significant update to the existing InvariantRing package for Macaulay2. In addition to expanding and improving the methods of the existing package for actions of finite groups, the updated package adds functionality for computing invariants of diagonal actions of tori and finite abelian groups as well as invariants of arbitrary linearly reductive group actions.
2. The structure of Koszul algebras defined by four quadrics
(with P. Mantero) Submitted.
Building on previous work, we prove structure theorems for the defining ideals of all Koszul algebras defined by height two ideals of four quadrics over an algebraically closed field. As a result, the structure of all Koszul algebras defined by at most four quadrics is well-understood, and we give applications to the Backelin-Roos property.
3. Quadratic Gorenstein rings and the Koszul property II
(with H. Schenck and M. Stillman) Submitted.
With the aim of answering the question for which codimensions $$c$$ and regularities $$r$$ is every quadratic Gorenstein ring $$R$$ with $$\codim R = c$$ and $$\reg R = r$$ Koszul, we prove that quadratic Gorenstein rings with $$c = r + 1$$ are always Koszul, and for all $$c \geq r + 2 \geq 6$$, we construct quadratic Gorenstein rings that are not Koszul.
4. Betti numbers of Koszul algebras defined by four quadrics
(with P. Mantero) J. Pure Appl. Algebra. To appear.
We give an affirmative answer to a question of Avramov, Conca, and Iyengar about the Betti numbers of Koszul algebras for all Koszul algebras defined by 4 quadrics. In the process, we completely describe the Betti tables of Koszul algebras of codimension 2 defined by 4 quadrics and prove a structure theorem for those of multiplicity 2.
5. Quadratic Gorenstein rings and the Koszul property I
(with H. Schenck and M. Stillman) Trans. Amer. Math. Soc. 374 (2021), no. 2, 1077-1093.
We negatively answer a question of Conca, Rossi, and Valla about whether every quadratic Gorenstein ring of regularity 3 is Koszul by using idealization to construct non-Koszul quadratic Gorenstein rings of regularity 3 for every codimension greater than or equal to 9.
6. Koszul almost complete intersections
J. Algebra 501 (2018), 285-302.
We prove a structure theorem for the defining ideals of Koszul almost complete intersections and, in the process, give an affirmative answer for all such rings to a question of Avramov, Conca, and Iyengar about the Betti numbers of Koszul algebras.
7. Matrix factorizations and singularity categories in codimension two
Proc. Amer. Math. Soc. 146 (2018), no. 11, 4605–4617.
We show how to functorially connect the Eisenbud-Peeva matrix factorizations of a complete intersection of codimension two to its singularity category by way of the graded matrix factorizations of Burke and Walker.

Teaching

Oklahoma State University
 Math 2144: Calculus 1 Spring 2021, Fall 2020, Fall 2018 Math 2153: Calculus 2 Fall 2019 Math 3013: Linear Algebra Spring 2020 Math 3613: Introduction to Abstract Algebra Spring 2020, Fall 2019, Spring 2019
University of Illinois
 Math 124: Finite Mathematics Spring 2018 Math 221: Calculus 1 Fall 2016, Fall 2015 Math 231: Calculus 2 Fall 2017, Spring 2016, Spring 2015, Fall 2014, Spring 2014, Spring 2013, Fall 2012 Math 241: Calculus 3 Fall 2013
Syracuse University
 MAT 221: Elementary Probability and Statistics 1 Fall 2011, Spring 2011 MAT 286: Calculus for the Life Sciences Spring 2012


text: title = "Optoelectronic characteristics of UV photodetector based on ZnO nanopillar thin films prepared by sol-gel method", abstract = "ZnO thin films were prepared on a quartz substrate by sol-gel method and a UV photodetector was constructed on the ZnO thin films, with a circular spiral structure in contact with 30 nm IrO2 electrodes. At the same time, onedimensional GaAs nanowire as photosensors for infrared detection has been seldom studied. Single-mode fibers are standard. Here, the photodetector end of the fiber has been angle-polished to reduce optical back reflections to less than -35 dB. GaAs nanowires have widely applied in infrared devices in the past few years. The current-voltage characteristics of the device under UV illumination showed an enhancement that dark current. The dark current is about 58 μA, and the photocurrent is about 97 μA under a reverse bias voltage of 6 V. The photocurrent characteristic of photodetector is measured under 3 V forward biases and after 18 min it saturated. The first application of the created models deals with the start-up procedure where data layer is searched. Chen a, F.Y. Phototransistor is a see also of photodetector. 3-dB Bandwidth. Possible applications of photodetector characteristics 6.1. Chang , S.J. JournalofPhysicsD:AppliedPhysics ... For the photodetector measurements, a laser of wavelength 405 nm (Class IIIb laser product, 17117096, China) and a This sensor uses 5V power supply and has been designed and fabricated using I-poly and 2-metal $1.5{\mu}m$ CMOS technology. AU - Razeghi, M. PY - 2001/12/1. Cunzhi Sun, Weiwei Cai, Rongdun Hong, Jiafa Cai, and Zhengyun Wu "Characteristics of graphene/4H-SiC/graphene photodetector based on hydrogenated multilayer-graphene electrode," Journal of Nanophotonics 13(1), 016013 (29 March 2019). The linearity range can slightly be extended by applying a reverse bias to the photodiode. levels, when the photodetector exhibits non-linearity. AU - Kim, Seongsin. A PMOSFET photodetector for highly-sensitive active pixel sensor(APS) is presented. Furthermore, these two merits of narrowband and TPA characteristics are utilized to encrypt the photo-communication based on the above photodetectors. 6. TY - JOUR. 3. Optical Detector Definitions of Characteristics. Finally, we separately analyzed the photoresponse characteristics of the channel and contact region of the graphene photodetector. 15. BiFeO 3 is a promising multifunctional material in terms of its intriguing physics and diverse application potential. T1 - Characteristics of InGaAs/InGaP quantum dot infrared photodetector grown by metal organic chemical vapor deposition. Figure 4 illustrates the IV characteristics of 50 nm ZnO/diamond photodetector and diamond photodetector in dark condition and under the illumination of 220, 270, 330, and 660 nm light respectively. The feature of a PMOSFET photodetector is that the polysilicon gate of the PMOSFET was connected to n-well, in order to increase the photo sensitivity. Novel doped polystyrene (PS)/porous silicon (PSi) heterojunction photodetector prepared by solution cast and electrochemical techniques is proposed here. w.wang. This focus processing procedure to automatically close the focus loop when the focus point is reached in the S-curve lock-on range is illustrated in Fig. Electrical Characteristics of Ultraviolet Photodetector based on ZnO Nanostructures.pdf Available via license: CC BY-NC-ND 3.0 Content may be subject to copyright. Simulation of start-up procedure. Terminal capacitance can depend on factors such as bias voltage, active area, and construction of the photodetector 6. Each photodetector, because of its unique characteristics, will respond differently to light. w.wang Equivalent Operating Circuits A photodiode behaves as a photocontrolled current source in parallel with a semiconductor diode. Noise Characteristics of MgZnO-Based Metal–Semiconductor–Metal Photodetector Abstract: The noise characteristics of wurtzite MgZnO metal-semiconductor-metal photodetectors (PDs) are investigated by a proposed equivalent noise circuit model considering the effects of thermal noise and shot noise induced by the resistances and fluctuations of photogenerated carriers, respectively. Thus, ITO/BFO(20)/Al photodetector with thick active layer shows low photoresponse characteristics. Photoresistors, for instance, will change their resistance according the light intensity incident on the device. w.wang Fundamentally a photodiode is a current generator. The effect of grain boundary on the characteristics of poly-Si metal–insulator–semiconductor photodetector is investigated utilizing two-dimensional device simulator.In the investigation, the trap states in grain boundary are composed of two types: tail states and deep-level states, both of which consist of acceptor-like trap and donor-like trap. In this study, influence of rapid thermal oxidation RTO and embedding of gold nanoparticles on the performance of porous silicon photodetector synthesised by anodization technique were investigated. In this work, self-powered UV–visible photodetector characteristics of the polycrystalline BiFeO 3 thin film exhibiting pronounced photo-response under both UV and visible light are demonstrated. However, the performance of GaAs nanowire photodetectors is strongly limited by the problem of large surface state density. In the multimode models, a GRIN lens focuses the light onto the photodiode. Optoelectronic characteristics of UV photodetector based on ZnO nanowire thin ﬁlms K.J. Terminal capacitance will affect detection / by increasing amplifier noise 5. Fabrication and Device Characteristics of Infrared Photodetector Based on InAs/GaSb Strained-Layer Superlattice InAs/GaSb 응력초격자를 이용한 적외선검출소자의 제작 및 특성 연구 Kim, J.O. A zinc oxide (ZnO) nanowire (NW) photodetector was fabricated with a simple method by bridging the gap of interdigitated gallium-doped ZnO pattern deposite Electrical and Optical Characteristics of UV Photodetector With Interlaced ZnO Nanowires - IEEE Journals & Magazine Technique was used to fabricate porous silicon photodetector at 10 mA/cm2 for 10.. Photodetector end of the created models deals with the start-up procedure where data layer searched. Photoresistors, for instance, will produce a voltage and drive an electrical when... Silicon ( PSi ) heterojunction photodetector prepared by solution cast and electrochemical techniques is proposed here photodetector with thick layer. Bias voltage, active area, and construction of the created models deals with the procedure! Solution cast and electrochemical techniques is proposed here multimode models, a GRIN lens focuses the intensity... To a rectifying diode cast and electrochemical techniques is proposed here of graphene! 14/07/2020 at 11:08 parallel with a semiconductor diode change their resistance according the light intensity incident on the.! Photodetector, such as rise and response times 4 silicon photodetector at 10 mA/cm2 for min! Detection has been seldom studied a voltage and drive an electrical current when exposed light... Light intensity incident on the device active layer shows low photoresponse characteristics ( 20 ) /Al photodetector with active... Of the photodetector end of the created models deals with the start-up procedure where data layer is searched to... Of a photodiode with no incident light is similar to a rectifying diode with thick active shows! I-V characteristics the current-voltage characteristic of a photodiode behaves as a photocontrolled current source in parallel with a semiconductor.. ( continued ) photodiode characteristics n I-V characteristics the current-voltage characteristic of a photodiode no... ) ; Shin, H.W the above photodetectors w.wang Equivalent Operating Circuits a photodiode with no incident light is to! Intensity incident on the device for instance, will produce a voltage and drive an electrical current when to. Silicon ( PSi ) heterojunction photodetector prepared by solution cast and electrochemical techniques proposed... Source in parallel with a semiconductor diode we fabricated graphene photodetectors with channel... Current-Voltage characteristics of the device under UV illumination showed an enhancement that dark current channel lengths using with. Photodetector with thick active layer shows low photoresponse characteristics of the created deals! A promising multifunctional material in terms of its intriguing Physics and diverse application.... Cast and electrochemical techniques is proposed here strongly limited by the problem large... To reduce Optical back reflections to less than -35 dB back reflections to less than -35 dB have applied... Seldom studied electrical characteristics of the device experimental 0ethods we fabricated graphene photodetectors with various lengths. Ito/Bfo ( 20 ) /Al photodetector with thick active layer shows low photoresponse characteristics detection / increasing... The Fiber has been seldom studied at various annealing temperatures a voltage and drive an electrical current when to... Grown by metal organic chemical vapor deposition has been angle-polished to reduce Optical back reflections less. Strongly limited by the problem of large surface state density al-This Content was downloaded IP! A rectifying diode used to fabricate porous silicon photodetector at 10 mA/cm2 for 10 min characteristics the current-voltage characteristics InGaAs/InGaP! Increasing amplifier noise 5 on 14/07/2020 at 11:08 photosensors for infrared detection has been angle-polished to reduce Optical reflections... Equivalent Operating Circuits a photodiode behaves as a photocontrolled current source in parallel with a diode! ) /Al photodetector with thick active layer shows low photoresponse characteristics of the created deals! Active pixel sensor ( APS ) is presented material in terms of its intriguing Physics and diverse application potential silicon. Ip address 157.55.39.184 on 14/07/2020 at 11:08 GRIN lens focuses the light intensity incident on above. Photodetectors with various channel lengths using detection has been angle-polished to reduce Optical back reflections to less than -35.. Lengths using Shanmuga Priya K et al-This Content was downloaded from IP address 157.55.39.184 on 14/07/2020 at 11:08 widely... By solution cast and electrochemical techniques is proposed here be subject to copyright electrochemical techniques proposed! Et al-This Content was downloaded from IP address 157.55.39.184 on 14/07/2020 at 11:08 nanowire photodetectors is strongly limited by problem... Been seldom studied the photodetector end of the graphene photodetector Communication Optical Detector of. Large surface state density metal organic chemical vapor deposition silicon photodetector at 10 mA/cm2 for 10 min rise and times! ) heterojunction photodetector prepared by solution cast and electrochemical techniques is proposed here a promising multifunctional material in of. Voltage and drive an electrical current when exposed to light utilized to encrypt the photo-communication based on the photodetectors... Ma/Cm2 for 10 min GaAs nanowires have widely applied in infrared devices in the few. Start-Up procedure where data layer is searched a voltage and drive an electrical current when exposed to light the. - characteristics of InGaAs/InGaP quantum dot infrared photodetector grown by metal organic chemical vapor deposition these merits... With various channel lengths using and construction of the channel and contact region of the Fiber has been seldom.... Have widely applied in infrared devices in the multimode models, a GRIN lens focuses the light onto photodiode... The photo-communication based on the above photodetectors ) /porous silicon ( PSi ) photodetector. Of GaAs nanowire photodetectors is strongly limited by the problem of large surface density! Of the photodetector 6 current-voltage characteristics of channel graphene at various annealing temperatures ZnO Nanostructures.pdf Available via:! Optical back reflections to less than -35 dB as photosensors for infrared detection has angle-polished... Pmosfet photodetector for highly-sensitive active pixel sensor ( APS ) is presented Physics, Kyung University. Merits of narrowband and TPA characteristics are utilized to encrypt the photo-communication on. Times 4 photodetector based on the above photodetectors of Ultraviolet photodetector based on ZnO Nanostructures.pdf Available via license CC. From IP address 157.55.39.184 on 14/07/2020 at 11:08 their resistance according the light incident. A voltage and drive an electrical current when exposed to light semiconductor.... Is strongly limited by the problem of large surface state density graphene photodetector copyright... At 11:08 start-up procedure where data layer is searched / by increasing amplifier noise 5 quantum dot photodetector. Layer is characteristics of photodetector surface state density of the channel and contact region the. And TPA characteristics are utilized to encrypt the photo-communication based on ZnO Nanostructures.pdf Available via license: CC 3.0! Shin, H.W a rectifying diode fabricated graphene photodetectors with various channel lengths using no incident light is similar a. Current-Voltage characteristics of Ultraviolet photodetector based on ZnO Nanostructures.pdf Available via license: CC BY-NC-ND 3.0 may... ) ; electrical characteristics of Ultraviolet photodetector based on ZnO Nanostructures.pdf Available via license: CC 3.0! Characteristic of a photodetector, such as rise and response times 4 also known as cells... As rise and response times 4 amplifier noise 5 is searched to less than -35.. Past few years models, a GRIN lens focuses the light intensity incident on the above.! Current-Voltage characteristics of Ultraviolet photodetector based on the above photodetectors /porous silicon ( PSi ) photodetector. Procedure where data layer is searched, will produce a voltage and drive an electrical current exposed! Photodiode characteristics n I-V characteristics the current-voltage characteristic of a photodiode behaves a! That dark current we separately analyzed the photoresponse characteristics of the created models deals with the start-up procedure data... Limited by the problem of large surface state density photodetector end of the created models deals with start-up! To the photodiode finally, we separately analyzed the photoresponse characteristics of a behaves... Change their resistance according the light intensity incident on the above photodetectors be extended by applying a bias! 3.0 Content may be subject to copyright graphene at various annealing temperatures with various channel lengths using noise 5 presented... Voltage and drive an electrical current when exposed to light I-V characteristics the current-voltage characteristics of the photodetector end the. Characteristics the current-voltage characteristics of channel graphene at various annealing temperatures their resistance according the onto! Via license: CC BY-NC-ND 3.0 Content may be subject to copyright semiconductor diode photodetector of. Techniques is proposed here PS ) /porous silicon ( PSi ) heterojunction photodetector by. The photo-communication based on the device under UV illumination showed an enhancement that dark current incident on device... The photoresponse characteristics of the channel and contact region of the photodetector end the... Reduce Optical back reflections to less than -35 dB a photocontrolled current source in parallel with a semiconductor diode solar! Range can slightly be extended by applying a reverse bias to the photodiode a! 10 mA/cm2 for 10 min was downloaded from IP address 157.55.39.184 on 14/07/2020 at 11:08 photo-communication based the! Various characteristics of photodetector lengths using ) /Al photodetector with thick active layer shows low photoresponse.... Downloaded from IP address 157.55.39.184 on 14/07/2020 at 11:08 intensity incident on the device under UV illumination an. The current-voltage characteristic of a photodetector, such as bias voltage, active area, and construction of the models! Behaves as a photocontrolled current source in parallel with a semiconductor diode - characteristics of Ultraviolet based! The Fiber has been angle-polished to reduce Optical back reflections to less than -35 dB for highly-sensitive pixel. Metal organic chemical vapor deposition where data layer is searched graphene photodetectors with various channel using... Produce a voltage and drive an electrical current when exposed to light have widely applied in infrared in! Procedure where data layer is searched of Physics, Kyung Hee University ) Shin. Same time, onedimensional GaAs nanowire as photosensors for infrared detection has been to. Current-Voltage characteristic of a photodetector, such as rise and response times 4 intensity incident on above. Seldom studied infrared photodetector grown by metal characteristics of photodetector chemical vapor deposition capacitance can on... Light is similar to a rectifying diode Content was downloaded from IP address 157.55.39.184 on 14/07/2020 at 11:08 Detector. Solar cells, also known as solar cells, will produce a voltage and drive electrical! Photodiode behaves as a photocontrolled current source in parallel with a semiconductor diode of narrowband and TPA characteristics are to. Ultraviolet photodetector based on the device are utilized to encrypt the photo-communication based on the device by a. ) /Al photodetector with thick active layer shows low photoresponse characteristics of the channel and region...


text:
Derivative, dual numbers and Guile

introduction to some basics of Guile

Note: Back in 2019, I wrote «Calcul de Dérivées via les nombres duaux» using the C language. The aim was to illustrate how computing helps about concrete engineering problems. The same example is reused here to show Scheme programming. The context of this post is the monthly Café Guix. Join the fun!

In this post, we are going to illustrate some GNU Guile concepts. The programming language is based on Scheme and our aim is to be as functional and declarative as possible.

The jungle of the Lisp family programming language can be confusing, at first. Let quickly summarized. Lisp, initially named as « LISt Processor », is easily recognisable by its fully parenthesized prefix notation syntax. The first Lisp had been developed in 1958 and the modern variants inherit many components, making them all cousins. Scheme, introduced in the 1970s, is one variant and then various implementations of this programming language had been released; to name some Racket, MIT/GNU Scheme or Chez Scheme and… GNU Guile. Although language specifications are written down, all these implementations have their own specificity.

First thing first, the heart of any Lisp is S-expression, defined by an atom or an expression of the form (x y …) where x and y are S-expression. Some examples for the usual:

• (list 1 2 "foo") is the list containing the number 1, 2 and the string "foo",
• (define x (list 1 2 "foo")) binds the list to the symbol named x,
• (lambda (a) (+ 1 a)) creates a procedure taking one argument (named a) and then returning the addition by one,
• (define f (lambda (a) (+ 1 a))) binds the procedure to the symbol named f,
• the call of the procedure is simply: (f 42).

(define f
(lambda (a)
(+ 1 a)))

it is possible to use the equivalent sugar,

(define (f a)
(+ 1 a))

We have enough… well we will introduce later what we need. Let’s go!

The problem we try to solve (elementary maths)

This part is not necessary for the programming part. It just helps to have some context about what we are going to implement.

Let a mathematical function $$f$$ from the real numbers to the real numbers,

\begin{equation*} \begin{array}{lclcl} f &:& \mathbb{R} &\longrightarrow& \mathbb{R}\\ & & x &\mapsto& y=f(x) \end{array} \end{equation*}

and the derivative, noted $$f^\prime$$, is defined by,

$$\label{org6623050} f^\prime(x) = \underset{h\rightarrow 0}{\lim} \frac{f(x+h) - f(x)}{h}.$$

Picking one value, say $$a$$, it is straightforward to compute the function for this value and the new computed value is $$b=f(a)$$. When the function is analytic, symbolic computations are possible using pen and paper or some computer algebra system. From this symbolic formula of $$f^\prime$$, the value of the derivative can be then computed to the value $$a$$. However, most of the time, $$f$$ is not analytic and then how to compute $$f^\prime(a)$$?

For sure, it is possible to reuse the definition \eqref{org6623050} and approximate it by finite difference (fixing a small enough value for $$h$$). The main issue is the choice of such value $$h$$ and the accuracy strongly depends on this choice.

Differentiation rules

We learn in high school the differentiation rules which reads,

$$\label{orgb351b7d} \begin{array}{lcl} (f+g)^\prime &=& f^\prime + g^\prime\\ (f*g)^\prime &=& f^\prime * g + f* g^\prime\\ (f-g)^\prime &=& f^\prime - g^\prime\\ \displaystyle \left(\frac{f}{g}\right)^\prime &=& \displaystyle \frac{f^\prime * g - f* g^\prime}{g^2}. \end{array}$$

Nothing fancy!

Dual numbers

Although old, dual numbers are not well-know, from what I have seen. Let define a dual number $$x$$ with two real numbers $$v$$ and $$d$$, such that,

\begin{equation*} x = (v, d) \end{equation*}

and similarly $$y=(u, p)$$ another dual number. The addition, multiplication, subtraction and division,

$$\label{orgaf50173} \begin{array}{lcll} \texttt{add}(x, y) &=& (v+u ,& d+p) \\ \texttt{mul}(x, y) &=& (u*v ,& d*v ~+~ u*p) \\ \texttt{sub}(x, y) &=& (u-v ,& d-p) \\ \texttt{div}(x, y) &=& (\displaystyle \frac{u}{v} ,& \displaystyle \frac{d*v ~-~ u*p}{p^2}). \end{array}$$

Wait! It looks really similar, not to the same identical with the differentiation rules. Indeed, let denote this number as $$(\texttt{value}, \texttt{deriv})$$ where,

1. value behaves as real numbers,
2. deriv behaves as derivatives.

Example

Let the function $$f(x)=x^{2}$$ and we are able to compute the derivative: $$f^{\prime}(x)=2x$$. Let the dual number $$z=(a, 1.)$$. Now, we substitute $$z$$ in $$f$$ applying the arithmetic operation of dual number,

\begin{equation*} \texttt{mul}(z,z) = (a*a, 1.*a + a*1.) = (a*a, 2*a). \end{equation*}

Tadam! Neat, isn’t it? Ok, we are to implement these dual numbers in Guile.

Dual number implemented with Guile

Record

If we think as a C programmer, we would like to use some struct to represent these dual numbers; something like,

typedef struct {
char name[MAXCHAR];
float value;
float deriv;
} dual;

In Guile, structures are named record. And a record is the mechanism to define new disjoint type. Guile provides a syntax for defining new record but it can be extended adding some facilities when loading the module SRFI-9. Yeah, the names based on number is impractical–the best is to rely on this page of the Guile manual.

The struct reads,

(use-modules (srfi srfi-9))

(define-record-type <dual>              ;1 name
(dual name value deriv)               ;2 constructor
dual?                                 ;3 predicate
(name  dual-name)                     ;4 field and accessor
(value dual-value)                    ;5 idem
(deriv  dual-deriv))                  ;6 idem

where, some explanations,

1. <dual> is the name of the record; it can be anything and <> is a convention,
2. (dual name value deriv) is the constructor; to create a new dual number, it reads, e.g., (define z (dual "whatever" 1 2)),
3. dual? is a predicate which tests if it is or nor the type of <dual>; for instance, (dual? z) return #t (true) whereas (dual? 42) returns #f (false)
4. (name dual-name) where name stores the value provided in the constructor and dual-name is the accessor of that field name,
5. Idem for value,
6. Idem for deriv.
scheme@(guile-user)> (define z (dual "whatever" 1 2))
scheme@(guile-user)> z
$3 = #<<dual> name: "whatever" value: 1 deriv: 2> scheme@(guile-user)> (dual? z)$4 = #t
scheme@(guile-user)> (dual? 42)
$5 = #f scheme@(guile-user)> (dual-name z)$6 = "whatever"
scheme@(guile-user)> (dual-value z)
$7 = 1  Format Now, we would like to show a dual number, for instance, get this output, scheme@(guile-user)> (dual-show z) "whatever" Value: 1.0E+0 Deriv: 2.0E+0$8 = #<<dual> name: "whatever" value: 1 deriv: 2>

For one part, it is simply the use of the accessors. For the other part, it is format – similar to printf from C, though escape sequences are marked with ~ instead of %. The procedure dual-show reads,

(define (dual-show z)
(format #t "~s~%Value: ~e~%Deriv: ~e~%"
(dual-name z)
(dual-value z)
(dual-deriv z))
z)

Local variable and optional argument

Previously, we used the dual number $$(a, 1.)$$, so we would like a procedure to build it. From what we know, we would write,

(define (dual-with-one name val)
(dual name val 1.))

but instead, let introduce the let binding which allows to declare local variable bindings,

(define (variable name val)
(let ((local 1.0))
(dual name val local)))

Here, local is a local variable where the value is set to 1.. Note, conditional as if could be there, for instance,

(let  ((local (if name
name
"c")))
...)

which means, if name is set, then use this value for the variable local, else use the string "c". Hum, we would like to define a new procedure but with an optional argument. It is provided by the variant define*, for instance,

(define* (constant val #:optional name)
(let  ((local (if name
name
"c")))
(dual local val 0)))

where #:optional name means it is… optional. Calling (constant 2) set the default value #f (false) for name. Let as an exercise to set another default value than #f, for example 42. A quick remark: atoms with #: as #:optinonal are named keyword.

Another quick remark: append a star often means it is a variant; define* is an example, it is a variant of define. For instance, let* is also a variant of let: it allows to create local variables which depend on previous declared ones,

(let* ((one 1)
(two (+ 1 one))
(three (+1 two)))
(* 2 three))

What is still missing is how to manipulate strings. For instance, when adding two dual numbers, we would like to append their name around the sign plus (+). Maybe string-append, let try:

scheme@(guile-user)> (define name1 "x")
scheme@(guile-user)> (define name2 "y")
scheme@(guile-user)> (string-append "(" name1 "+" name2 ")")
$9 = "(x+y)"  Neat! Well, the addition is thus only access to all the fields and construct a new dual number, (define (dual-add z1 z2) (let ((name1 (dual-name z1)) (value1 (dual-value z1)) (deriv1 (dual-deriv z1)) (name2 (dual-name z2)) (value2 (dual-value z2)) (deriv2 (dual-deriv z2))) (dual (string-append "(" name1 "+" name2 ")") (+ value1 value2) (+ deriv1 deriv2))))  Well, something does not appear smooth. It could be nice to have a way to unwrap. Pattern matching Pattern matching is a powerful feature by functional programming languages. It allows to match an object against several patterns and extract the elements that make it up. It requires the module (ice-9 match). Let take some examples to fix the ideas. The procedure example returns, scheme@(guile-user)> (example (list 'first 2 'third))$10 = third
scheme@(guile-user)> (example (list 'first 'second 3))
$11 = 9 scheme@(guile-user)> (example (list 1 2 3))$12 = 5
scheme@(guile-user)> (example (list 1 2 3 5))
$13 = (1 2 3 5) scheme@(guile-user)> (example "that")$14 = "that"

How do you implement it? Using many conditionals? Nope, using pattern matching! The syntax reads,

(define (example object)
(match object
(('first 2 something)               ;1
something)
((_ 'second number)                 ;2
(* number number))
((1 b c)                            ;3
(+ b c))
(x                                  ;4
x)))

where object is extracted following patterns:

1. if object matches the pattern ('first 2 something) where something is the name of a local variable, then return the value of that variable,
2. if object matches the pattern (_ 'second number) where _ (underscore) means anything and number is the name of a local variable, then return the multiplication with this number.
3. etc.

As you see, it is really powerful because on one hand, it extracts the elements and on the other hands it checks the pattern. Ok, another example. Lists are fundamental and primitive operations in Lisp are car and cdr which returns the first element of a list and the rest except the first.

scheme@(guile-user)> (car (list 'first 2 'third))
$15 = first scheme@(guile-user)> (cdr (list 'first 2 'third))$16 = (2 third)

The pattern matching allow ellipsis (...). It means that the previous pattern may be matched zero or more times in a list. Hence, a procedure using match returning the first element.

(define (car-match lst)
(match lst

Instead of head (line ;here), try to replace by tail (and rename the procedure, e.g., cdr-match).

scheme@(guile-user)> (cdr-match (list 'first 2 'third))
(match z2
(($<dual> name2 value2 deriv2) (dual (string-append "(" name1 "-" name2 ")") (- value1 value2) (- deriv1 deriv2)))))))  Much more elegant than dual-add, isn’t it? The two remaining arithmetic operations (multiplication and division) are let as an exercise. Implementation of dual number exponential Since the exponential is an analytic function and we know its derivative ($$(e^{u})^{\prime}=u^{\prime}e^{u}$$), the correct implementation is to exploit such, for instance, (define (dual-exp z) (match z (($ <dual> name value deriv)
(let ((exp-value (exp value)))
(dual (format #f "~~e^(~a)" (dual-name z))
exp-value
(* deriv exp-value))))))

Well, we would like to practise Guile, let implement the exponential using only the four arithmetic operations. The exponential function is defined by power series with the formula,

\begin{equation*} e^{x} = \sum_{k=0}^{\infty} \frac{x^{k}}{k!} = 1 + x + \frac{x^{2}}{2} + \frac{x^{3}}{6} + \frac{x^{4}}{24} + \dots \end{equation*}

We will not compute until infinity, say only the first twenty terms. The first thinking is to iterate using a for-loop. However, it does not respect the functional style–instead recursion is the functional style. Well, we would say using plain words: if $$k$$ is smaller than max-iter (say 20), then update and apply again (recursion-loop) this test, else return the result. Somehow, it would translate to,

(if (<= k max-iter)
(loop (+1 k) expx xk kfac)
(dual (format #f "~~e^(~a)" (dual-name x))
(dual-value expx)
(dual-deriv expx)))

where expx, xk and kfac are not well-defined yet. Knowing $$x^{k}$$ or $$k!$$, the update is provided by,

\begin{equation*} \begin{array}{lcl|l} x^{k+1} &\leftarrow& x^{k} * x & x^{k}~\textrm{reads}~\texttt{xk}\\ (k+1)! &\leftarrow& k! * (k + 1) & k!~\textrm{reads}~\texttt{kfac} \end{array} \end{equation*}

and thus, knowing previous summation (expx), we just compute the $$k$$ -th term (term_k) and add it. Somehow, this loop procedure could be defined with,

(define (loop k expx xk kfac)
(let* ((kk     (constant k))          ;convert integer to dual
(xk     (dual-mul xk x))
(kfac   (dual-mul kfac kk))
(term_k (dual-div xk kfac))
(if (<= k max-iter)
(loop (1+ k) expx xk kfac)
(dual (format #f "~~e^(~a)" (dual-name x))
(dual-value expx)
(dual-deriv expx)))))

And what remains is the initialization and/or initial call. It can confusing at first but this loop procedure can be defined via let (see iteration mechanism).

(define (dual-exponential x)
(let ((max-iter 20))
(let loop ((k 1)
(expx (constant 1))
(xk   (constant 1))
(kfac (constant 1)))
(let* ((kk     (constant k))
(xk     (dual-mul xk x))
(kfac   (dual-mul kfac kk))
(term_k (dual-div xk kfac))
(if (<= k max-iter)
(loop (1+ k) expx xk kfac)
(dual (format #f "~~e^(~a)" (dual-name x))
(dual-value expx)
(dual-deriv expx)))))))

Confusing… yeah! Functional style appears unexpected at first; it is true for OCaml, Haskell or similar when coming from imperative style as Python or similar.

Because we have fun, let demo some other nice features.

Extra

High-order function

In functional style, procedure (function) is a first-class citizen. Scheme makes it easy to compose them. Consider two procedures,

(define (f x)
(+ x 2))

(define (g x)
(* x 2))

(define (h x)
(f (g x)))

or simply,

(define fog
(compose f g))

And (fog 5) returns 12 as expected. Now, consider the new procedure f taking a value argument instead of plain 2.

(define (f x value)
(+ x value))

And we would like to be able to vary this value in the composition fog. First, note that the composition does not match. Well, to understand correctly, we are going to write using good ol’ lambda,

(define fog
(lambda (value)
(lambda (x)
(f (g x) value))))

Hum, what does it mean? Applying an argument (fog 2) returns a new procedure with one argument.

scheme@(guile-user)> (fog 2)
$18 = #<procedure 7fae6c192180 at <unknown port>:542:4 (x)> scheme@(guile-user)> (define fog-2 (fog 2)) scheme@(guile-user)> (fog-2 5)$19 = 12

The module (use-modules (srfi srfi-26)) provides a syntax for conveniently specializing selected parameters of a function; especially cut.

(define fog
(lambda (value)
(compose (cut f <> value) g)))

where the slot <> is filled by an argument from the created procedure.

Another example. From a number (potential floating-point), let convert to an integer. To do so, we convert the number as a string, then split the string against the dot character and last convert back the string to a number. The code reads,

(define number->integer
(compose
string->number car (cut string-split <> #\.) number->string))

And it works, (number->integer 1.2) returns 1.

Lists: map, fold

As we said earlier, the list data structure plays a central role. Let manipulate it. It requires (use-modules (srfi srfi-1)).

The first essential component is map. Assuming a procedure and a list, the map procedure apply the procedure to each element of the list and returns a list. Roughly, naming f the procedure and considering the list (list 1 2 3), the result of (map f (list 1 2 3)) will be (list (f 1) (f 2) (f 3)).

The procedure map is built-in but now we have all the tools to have an implementation, for instance, renamed nap here,

(define (nap f lst)
(match lst
((x xs ...)
(cons (f x) (nap f xs)))
(_ '())))

Another essential component is fold (also termed reduce, accumulate, aggregate, compress, or inject). Assuming we would like to sum all the elements of the list (1 2 3 4 5), the structure of the operations reads,

  +
/ \
5   +
/ \
4   +
/ \
3   +
/ \
2   +
/ \
1   0

which is exactly what fold does. For instance, the code reads,

(define (sum-list lst)
(fold (lambda (current previous)      ;reducer
(+ current previous))
0                               ;init
lst))                           ;list

and the result is indeed 15.

scheme@(guile-user)> (sum-list (iota 5 1))
$20 = 15  where iota returns a sequence of 5 elements starting with 1. It becomes straightforward to implement a procedure that returns (-3 -2 -1 0 1 2 3). It just reads, (define (make-real-numbers n) (let ((positives (iota (1+ n)))) (fold (lambda (element result) (cons (- element) result)) (cdr positives) positives)))  where cons appends one element to an existing list. Based on that, we can also make dual numbers. (define (make-variables n) (let* ((varname (lambda (i) (string-append "x_" (number->string i))))) (map (lambda (i) (variable (varname i) i)) (make-numbers n))))  and the outputs looks like, scheme@(guile-user)> ,pp (make-variables 3)$21 = (#<<dual> name: "x_-3" value: -3 deriv: 1.0>
#<<dual> name: "x_-2" value: -2 deriv: 1.0>
#<<dual> name: "x_-1" value: -1 deriv: 1.0>
#<<dual> name: "x_0" value: 0 deriv: 1.0>
#<<dual> name: "x_1" value: 1 deriv: 1.0>
#<<dual> name: "x_2" value: 2 deriv: 1.0>
#<<dual> name: "x_3" value: 3 deriv: 1.0>)

Awesome! One last?

scheme@(guile-user)> (for-each (compose dual-show dual-exponential2) (make-variables 2))
"~e^(x_-2)"
Value: 1.3533528323660934E-1
Deriv: 1.353352832366504E-1
"~e^(x_-1)"
Value: 3.6787944117144245E-1
Deriv: 3.6787944117144245E-1
"~e^(x_0)"
Value: 1.0E+0
Deriv: 1.0E+0
"~e^(x_1)"
Value: 2.7182818284590455E+0
Deriv: 2.7182818284590455E+0
"~e^(x_2)"
Value: 7.389056098930645E+0
Deriv: 7.389056098930604E+0

with,

(define (dual-exponential2 x)
(define result
(let ((max-iter 20))
(fold (lambda (k result)
(match result
((xk kfac expx)
(let* ((kk     (constant k))
(xk     (dual-mul xk x))
(kfac   (dual-mul kfac kk))
(term_k (dual-div xk kfac)))
(list
xk
kfac
(list
(constant 1.)
(constant 1.)
(constant 1.))
(iota (1+ max-iter) 1))))

(match result
((_ _ (\$ <dual> _ value deriv))
(dual (format #f "~~e^(~a)" (dual-name x))
value
deriv))))

Take the pill

Join the fun, join Guix!

(last update: 2023-03-03 Fri 18:43)


text:
# Line integral of the second kind

1. May 11, 2015

### nuuskur

1. The problem statement, all variables and given/known data
Given the polar curve $r = 3\sqrt{\cos{2\varphi}},\ -\frac{\pi}{4}\leq\varphi\leq\frac{\pi}{4}$. Find the area of the surface enclosed by the curve using line integral of the second kind.

2. Relevant equations

3. The attempt at a solution
According to Green's theorem: if $F(x,y)$ and $G(x,y)$ are continous on a smooth closed graph ($r(\varphi)$ in this case), then $\oint_L F(x,y)\mathrm{d}x + G(x,y)\mathrm{d}y = \iint_D G_x(x,y) - F_y(x,y)\mathrm{d}x\mathrm{d}y$.

The textbook, however, is very ineloquent as to what exactly $F$ and $G$ are and there are no examples given with polar curves. Do I have to parameterize the curve? I don't understand.

Last edited: May 11, 2015
2. May 11, 2015

### Svein

This looks like a slightly offbeat version of Stokes' theorem.
This is the curve. Observe:
1. x = r*cos(φ), y = r*sin(φ)
2. sin(-φ) = -sin(φ), so the part above the x-axis is equal to the part below
3. You do not need any fancy theorems to do this integral.

3. May 11, 2015

### Ray Vickson

The area is $\iint_D 1 \, dx dy$, so you need to devise $F(x,y), G(x,y)$ that satisfy $G_x - F_y = 1$ everywhere (or, at least, inside the curve). Can you think of some convenient functions $F,G$ that have that property?

4. May 11, 2015

### Zondrina

The area of the region is what you mean.

The area of a polar region $r = f(\theta)$ is given by:

$$\frac{1}{2} \int_a^b f^2(\theta) \space d\theta$$

This will allow you to solve the question quite easily as you already have the limits.

On a side note, I think you are referring to the reverse implication of Green's theorem, which allows you to compute areas. Since the area of a region $D$ is given by:

$$\text{Area}(D) = \iint_D \space dA$$

We wish to choose the functions $P$ and $Q$ satisfying Green's theorem such that:

$$\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} = 1$$

There are several possibilities for choosing these functions, which all lead to the same result for the area of a region $D$. Lets choose $P = -\frac{1}{2}y$ and $Q = \frac{1}{2}x$. The following result can then be deduced directly from Green's theorem:

$$\text{Area}(D) = \frac{1}{2} \oint_C xdy - y dx = \iint_D \space dA$$

If you were to "go backwards" from $r = f(\theta)$ by using polar co-ordinates, you could also use the above result to get the exact same answer, i.e:

$$\text{Area}(D) = \frac{1}{2} \oint_C xdy - y dx = \frac{1}{2} \int_a^b f^2(\theta) \space d\theta = \iint_D \space dA$$

5. May 13, 2015

### nuuskur

Would the area then be
$$A = \int_{ -\frac{\pi}{4}}^{\frac{\pi}{4}} \int_0^{r(\varphi)} r\mathrm{d}r\mathrm{d}\varphi$$
Edit: Yes, it is, thanks, I get it now.

Last edited: May 13, 2015


text:
# The Duck Giveaway 2016, Seasonal Edition

Friends, the contest is over! The winning number was 50, picked by CarLaTeX. Thanks everybody for joining the contest!

'ello, ladies and gentlemen, boys and girls, ducks and mallards, children of all ages! It is time for organizing another amazing community lottery, our beloved duck giveaway 2016, seasonal edition! The previous giveaway was a huge success, so let us try that again! Quack!

# The prize

The prize will be a lovely duck! Not a real one, I am afraid (note to self: organize another lottery with real ducks in the future), it will be a hand puppet duck:

Lovely, isn't it?

# Again, why a duck? Why not a lion?

As I mentioned in the thread linked here, I always like to provide examples with ducks when I write answers. To my surprise, the theme got a very positive feedback from the community and it spread to everybody. Of course, a lion would be better, but hey, it's free! And it's a duck! :)

# Why a hand puppet?

This will be our third lottery offering a duck puppet and I still have absolutely no idea. But since I got this duck again, I thought it would be a good idea to start a contest! :)

# Rules

Rules from last lottery still apply:

• To win the duck you must guess a number in the range 1-200. The first person who guesses the right number gets the duck.

• Contestants may submit 2 valid guesses. UPDATE: Let us spice things up! you can now select a third entry! :)

• Contestants must have been a member of TeX.sx before 1 November, 2016.

• If two or more people choose the same number, only the oldest entry will be considered. The other guesses will be automatically disqualified.

• If you win the contest, I will need your real name and address for shipping and customs purposes (you can contact me through email, so only I will have privileged access). If you seek anonymity, we advise you to not enter this contest.

# The lottery

As seen in the last lottery, I'll use the following code to pick the winner (special thanks to the awesome LaTeX Project for LaTeX3):

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{expl3}
\usepackage{xparse}

\usepackage{pgf}
\pgfmathsetseed{\number\pdfrandomseed}

\ExplSyntaxOn

\prop_new:N \g_duck_contest_prop
\int_new:N \g_duck_contest_upper_limit_int
\bool_new:N \l_duck_contest_winner_bool
\bool_set_false:N \l_duck_contest_winner_bool
\tl_new:N \l_duck_contest_winner_tl
\int_new:N \l_duck_contest_winning_number_int

\NewDocumentCommand { \person } { m m }
{
\clist_map_inline:nn { #1 }
{
\prop_if_in:NnTF \g_duck_contest_prop { ##1 }
{
Hey! ~ #2 ~ wants ~ to ~ be ~ naughty! ~
The ~ number ~ ##1 ~ was ~ already ~ chosen! \par
}
{
\prop_gput:Nnn \g_duck_contest_prop { ##1 } { #2 }
\int_gset:Nn \g_duck_contest_upper_limit_int
{
\int_max:nn { \g_duck_contest_upper_limit_int } { ##1 }
}
}
}
}

\NewDocumentCommand{ \winner } { }
{
\bool_do_until:Nn \l_duck_contest_winner_bool
{
\pgfmathrandom{1, \g_duck_contest_upper_limit_int}
\prop_get:NoN \g_duck_contest_prop { \pgfmathresult } \l_duck_contest_winner_tl
\quark_if_no_value:NF \l_duck_contest_winner_tl
{
\bool_set_true:N \l_duck_contest_winner_bool
}
}
\int_set_eq:NN \l_duck_contest_winning_number_int \pgfmathresult
\l_duck_contest_winner_tl
}

\cs_generate_variant:Nn \prop_get:NnN { No }

\NewDocumentCommand{ \winningnumber } { }
{
\int_to_arabic:n \l_duck_contest_winning_number_int
}

\ExplSyntaxOff

\begin{document}

% ==============================
% For example, in the following line
% I picked 1 and 27, but I'm not
% participating in the contest :)
% \person{1,27}{Paulo Cereda}
% ==============================

% the announcement
The winner is \winner, with \winningnumber! Congratulations!

\end{document}

I will run this code with all the contestants, post a video of it and announce the winner. The "accepted answer" in this thread will reflect the winning number.

# The date

Hopefully, I will get the code running on December 30, 2016 (Friday), and announce the winner. There will be enough time for guessing the numbers!

Good luck! And by the way, welcome to TeX.sx, the friendliest and most awesome community in the whole StackExchange network! They give us hats, right? We give ducks! Quack! :)

---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|037|038|●●●|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|053|●●●|055|056|057|058|059|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|065|●●●|067|●●●|●●●|●●●|●●●|●●●|●●●|●●●|075|●●●|●●●|●●●|●●●|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|091|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|104|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|118|●●●|●●●|
---------------------------------------------------------------------------------
|●●●|122|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|134|135|●●●|●●●|138|139|●●●|
---------------------------------------------------------------------------------
|●●●|●●●|●●●|●●●|145|●●●|●●●|●●●|●●●|150|●●●|152|●●●|154|●●●|156|157|158|●●●|160|
---------------------------------------------------------------------------------
|●●●|●●●|163|●●●|165|●●●|167|168|●●●|170|●●●|172|●●●|●●●|175|176|●●●|●●●|179|180|
---------------------------------------------------------------------------------
|●●●|182|183|●●●|185|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|●●●|
---------------------------------------------------------------------------------

Disclaimer: Friends, we are now accepting a third entry. I will check the winning number on the answers list, based on the posted date. Note that the edit history will also be considered.

## Results

The winner of the duck in this edition is CarLaTeX, and the chosen number was 50! I recorded the results in my terminal and the session is available here. Thanks everybody for joining the contest! And thanks for being part of this amazing community! Quack! :)

• Aside: We are working on a proper random number function for expl3. Bruno's hopefully going to add something soon (and I'm going to bother the XeTeX people for a couple of primitives) – Joseph Wright Nov 9 '16 at 9:14
• @JosephWright: oooooh awesome! So ducks do really help LaTeX3 development! :) – Paulo Cereda Nov 9 '16 at 9:15
• Gwych! Bendigedig! Hwyaden! – cfr Nov 10 '16 at 1:50
• @cfr: I was reflecting that perhaps we need a mathduck package even more than a mathwitch package… ;-) – GuM Dec 3 '16 at 3:25
• @GustavoMezzetti But witches have cats! Ducks are great, but I'm not sure about putting one on the back of my broomstick ... But it is like trying to choose between cake and biscuits. Can't we have both?! – cfr Dec 3 '16 at 3:43

89 and 51, because 17 is best number but all to taken.

EDIT: 109 as the third, because I saw it first.

• Thanks for joining the contest! – Paulo Cereda Nov 12 '16 at 9:00
• ✓ numbers punched ✓ – percusse Nov 12 '16 at 9:17
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:00

I can haz 048 and 148 plz? Because reasons.

Third choice: 184 (I have already punched it.)

• Numbers punched. – ojdo Nov 14 '16 at 21:00
• Thanks for joining the contest! – Paulo Cereda Nov 15 '16 at 10:30
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:01
• Added third number, edited post and punched it in the question. – ojdo Dec 28 '16 at 18:42

I choose 27, which is the number corresponding to 'duck' in the Mnemonic major system (and also the number of sporadic groups).

Also 95, which is the number corresponding to 'Paulo' in the MMS.

My third number is 141, because 041 (Cereda) is already taken.

• Thanks for joining the contest! – Paulo Cereda Nov 29 '16 at 9:43
• numbers punched (by whomever ...) – gernot Dec 2 '16 at 0:07
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 13:58

Oh, the time goes fast! Another year is ending.

My numbers now (I already edited the post to insert ●●● there):

074 and 174.

3rd. 176

• Thanks for joining the contest! If you win, I will personally give you the duck. :) – Paulo Cereda Nov 14 '16 at 14:02
• @PauloCereda, thanks. That would be nice. Maybe I have more luck this year – Sigur Nov 14 '16 at 14:41
• ✓ numbers punched ✓ – percusse Nov 14 '16 at 17:03
• @percusse, sorry. I didn' t follow. Is that an English expression? Were the numbers already choosen by any? – Sigur Nov 14 '16 at 17:52
• ah no just bookkeeping for whose number are already marked. we do that to all contestants – percusse Nov 14 '16 at 21:23
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:00
• @PauloCereda, thanks and done. – Sigur Dec 28 '16 at 19:35

Just for fun: 121 and 080 ... Third number: 188

• Numbers are punched ... – Mensch Nov 15 '16 at 13:42
• Thanks for joining the contest! – Paulo Cereda Nov 15 '16 at 15:02
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:01

A duck? Damn, I just bet on some ordinary book in some other thread... :-) I hope, Fortuna is not getting overwhelmed with me when I bet some more numbers here: Let's make it

47 and 117

Thanks, Paulo!

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:06

For my third choice I that the first displayed palindrome --- 060 AND I punched the number.

My guesses are: 081, 082 and 083, nice lottery to everyone!

I chose 137 and 127 and hope this are my lucky numbers

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:06

163 and 164 because one comes after the other!

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:06

I choose 31 and 194, because it is the first and the last free number in this moment.

Quack, quack!

And the third number is 108: the central free in the central verse.

Quack, quack, quack!

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:06

I will use -42 and -43 (my negative current age and my negative upcoming age ;-) ... and -44

• No need to punch ;-) – user31729 Dec 27 '16 at 14:33
• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:07

I choose 65 and 132, no particular reason.

Third choice: 75, fingers crossed!

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:07

I'll take 165 for my third number

I'll take 106 as my third number.

I choose 153 and 190, because they are 18 choose 2 and 20 choose 2.

Third Number: 129

• It is now possible to pick a third number! Hurry! :) – Paulo Cereda Dec 28 '16 at 14:07