Function Repository Resource:

SchmidtArrangements

Source Notebook

Generate Schmidt arrangements of circles

Contributed by: Christophe Favergeon

ResourceFunction["SchmidtArrangements"][d]

generates a picture of a Schmidt arrangement for a quadratic field generated with the root .

Details and Options

ResourceFunction["SchmidtArrangements"] takes the following options:
"Color"Blackthe specification of a color or color palette
"Circle"Truespecify if circles or disks are used for the picture
"Transparency"0.0specify the transparency value or transparency mode
"Filter"Circle[{0,0.5},Sqrt[0.25]]specify the shape used to clip the picture
"MinCurvature"0specify the minimum circle curvature in the picture
"MaxCurvature"20specify the maximum circle curvature in the picture
"XMax"1.0maximum horizontal coordinate value used to search for new circles
"YMax"1.0maximum vertical coordinate value used to search for new circles
"Containment"Truespecify if a circle can contain other circles
"Precompute"Falsespecify if the pre-computation mode is enabled
"Color" can be used to specify a color like Black.
"Color" can be a color palette: "Color"ColorData["SolarColors"].
In a Schmidt arrangement, all curvatures are an integer multiple of a common value. So, curvatures are expressed as integers. The value for the color palette is normalized between 0.0 and 1.0 such that 0.0 corresponds to the minimum integer curvature and 1.0 to the maximum.
"Color" can be a special color palette provided with the ResourceFunction["SchmidtArrangements"] function: "Color"{"ColorPool",{1,0}}.
Special palettes are defined with {"nameofpalette",{a,b}} or {"nameofpalette",{n,a,b}}.
The color index is given by (c*a+b) mod n where c is the curvature expressed as an integer.
n can be any number less than or equal to the number of colors in a given palette.
The "Color" option can also be a special gradient which is an interpolation between palettes as follows: "Color"{"Gradient",{colfuncstart,colfuncend}}.
The value of the "Color" option can either be a ColorData expression or a special color palette.
The special color palettes recognized by this function are:
Length of the paletteColor names
4 colors"ColorCu", "ColorSaul", "ColorAntique", "ColorGreen", "Color92", "ColorGolden", "ColorPool", "ColorDistinct", "ColorNightlife", "ColorA", "ColorB", "ColorC"
5 colors"Color5"
6 colors"Color6", "Color6Alt", "Color6Seeds"
24 colors"Color24"
These names come from the original Sage notebook by Katherine E. Stange and Daniel E. Martin.
Use the setting "Circle" False to get disks rather than circles in the diagram.
"Transparency" is used to vary the transparency according to the circle curvature. Two settings are supported: "Increasing" and "Decreasing".
"Filter" is used to clip the final picture with a Rectangle or Circle. By default, a circle is used for clipping. Note that this setting will only check the center of the circles and draw circles if their center is inside the shape. The circle boundary can be outside the clipping shape.
"MinCurvature" and "MaxCurvature" limit the curvatures. These are the only two options which are used both in precompute and drawing mode. They can have different values for each mode.
"XMax" and "YMax" are used to limit the region of the plane where circles are searched.
"Containment" is set to True when a circle cannot contain any other circles. Circles contained in another circle will be removed.
"Precompute" is used to separate the compute phase from the styling and drawing phase.

Examples

Basic Examples (1) 

Schmidt arrangement for the Gaussian integers:

In[1]:=
ResourceFunction["SchmidtArrangements"][-1]
Out[1]=

Scope (10) 

Schmidt arrangement for the Gaussian integers with a specific color palette:

In[2]:=
ResourceFunction["SchmidtArrangements"][-1, "Color" -> {"ColorPool", {1, 0}}]
Out[2]=

Use the same color palette but restrict its length:

In[3]:=
ResourceFunction["SchmidtArrangements"][-1, "Color" -> {"ColorPool", {2, 1, 0}}]
Out[3]=

Use a standard ColorData function and plot disks rather than circles with transparency "Decreasing":

In[4]:=
ResourceFunction["SchmidtArrangements"][-1, "Circle" -> False, "Color" -> ColorData["SolarColors"], Background -> White, "Transparency" -> "Decreasing"]
Out[4]=

A radial gradient can be specified using the special palettes provided:

In[5]:=
ResourceFunction["SchmidtArrangements"][-1, "Circle" -> False, "Color" -> {"Gradient", {"ColorPool", {1, 2}}, {"ColorPool", {1, 1}}}]
Out[5]=

It is possible to limit the drawing by setting "Filter" to a Rectangle:

In[6]:=
ResourceFunction["SchmidtArrangements"][-1, "MaxCurvature" -> 40, "Color" -> {"ColorSaul", {2, 1, 1}},
 "Transparency" -> "Increasing", "Filter" -> Rectangle[{-0.1, -0.1}, {1.1, 1.1}],
 PlotRange -> {{0, 1}, {0, 1}}]
Out[6]=

Graphics options are supported. Here is an example with the use of a background color:

In[7]:=
ResourceFunction["SchmidtArrangements"][-2, "MaxCurvature" -> 40, "Color" -> {"ColorSaul", {2, 1, 1}},
 "Transparency" -> "Increasing", "Filter" -> Rectangle[{-0.1, -0.1}, {1.1, Sqrt[2.0] + 0.1}],
 PlotRange -> {{0, 1}, {0, Sqrt[2.0]}}, Background -> Black]
Out[7]=

Use the quadratic field generated by . The region of the plane is a bit bigger, so this example takes more time to compute:

In[8]:=
ResourceFunction["SchmidtArrangements"][-3, "MinCurvature" -> 0, "MaxCurvature" -> 10, "Color" -> {"ColorSaul", {2, 1, 1}},
 "Transparency" -> "Increasing", "Filter" -> Rectangle[{-2.1, -Sqrt[3.0] - 0.1}, {2.1, 2*Sqrt[3.0] + 0.1}],
 PlotRange -> {{-2, 2}, {0, Sqrt[3.0]}}, ImageSize -> Large]
Out[8]=

"XMax" and "YMax" limit the region of the plane used to look for new circles (as opposed to the "Filter" option which limits the drawing):

In[9]:=
ResourceFunction["SchmidtArrangements"][-15, "MinCurvature" -> 0, "MaxCurvature" -> 20, "Color" -> {"ColorSaul", {1, 0}},
 "XMax" -> 10.0, "YMax" -> 2.0,
 "Filter" -> Rectangle[{-0.1, -0.1}, {5.1, Sqrt[15.0] + 0.1}],
 "Circle" -> False, PlotRange -> {{0, 5}, {0, Sqrt[15.0]/2.0}}, ImageSize -> Large]
Out[9]=

When the computation takes a long time, it is a good idea to first compute the circles (slow operation) and then style and display the result (quick operation). The option "Precompute" is used for this. Note that "MinCurvature" and "MaxCurvature" can have different values when precomputing versus displaying the circles:

In[10]:=
precomputed = ResourceFunction["SchmidtArrangements"][-1, "MaxCurvature" -> 100, "Precompute" -> True]; // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
In[11]:=
ResourceFunction["SchmidtArrangements"][precomputed, "Circle" -> False, "Containment" -> False, "MinCurvature" -> 2, "MaxCurvature" -> 100, "Color" -> {"Color24", {1, 4}}] // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
Out[11]=

This example takes a long time because the "MaxCurvature" is very high. Using precomputation allows us to store the results and restyle the diagram quickly:

In[12]:=
precomputed2 = ResourceFunction["SchmidtArrangements"][-1, "MaxCurvature" -> 100, "Precompute" -> True]; // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
In[13]:=
ResourceFunction["SchmidtArrangements"][precomputed2, "Circle" -> False, "Color" -> {"Color92", {0, 0}},
  "Transparency" -> 0.5, "MinCurvature" -> 2, "MaxCurvature" -> 100] // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
Out[13]=

Different stylings with the same precomputed arrangement:

In[14]:=
ResourceFunction["SchmidtArrangements"][precomputed2, "Circle" -> False, "Color" -> {"ColorA", {0, 0}},
  "Transparency" -> 0.5, "MinCurvature" -> 2, "MaxCurvature" -> 100] // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
Out[14]=
In[15]:=
ResourceFunction["SchmidtArrangements"][precomputed2, "Circle" -> False, "Color" -> {"Color5", {1, 0}},
  "Transparency" -> "Increasing", "MinCurvature" -> 0, "MaxCurvature" -> 75,
  "Filter" -> Circle[{0., 0.5}, Sqrt[0.25]]] // ResourceFunction[
ResourceObject[<|"Name" -> "EchoTiming", "ShortName" -> "EchoTiming", "UUID" -> "b6064c2f-0a91-4537-8ac3-ef527c794326", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Print the timing for an evaluation and return the result", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "GeneralUtilities`EchoTiming", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/579490e1-7faa-43b0-a99d-0f4188efc7c8"]|>, ResourceSystemBase -> Automatic]]
Out[15]=

We can also overlay two different styles to create more artistic combinations:

In[16]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/578b0790-dcc6-4c11-a459-6c075c13233d"]
Out[16]=

Use the quadratic field generated by :

In[17]:=
ResourceFunction["SchmidtArrangements"][-3, "MinCurvature" -> 0, "MaxCurvature" -> 30, "Color" -> Blue,
 "Filter" -> Rectangle[{-0.1, -0.1}, {1.1, 1.1}], PlotRange -> {{-0.1, 1}, {0, 1.0}}, ImageSize -> Large]
Out[17]=

Use the same quadratic field but with a bigger "MaxCurvature" and using "Precomputation":

In[18]:=
pre = ResourceFunction["SchmidtArrangements"][-3, "MaxCurvature" -> 100, "Precompute" -> True];
In[19]:=
ResourceFunction["SchmidtArrangements"][pre, "MinCurvature" -> 0, "MaxCurvature" -> 30, "Color" -> ColorData["BrightBands"], "Transparency" -> "Increasing",
 "Filter" -> Rectangle[{-0.1, -0.1}, {1.1, 1.1}], PlotRange -> {{-0.1, 1}, {0, 1.0}}, ImageSize -> Large, Background -> Black]
Out[19]=

This last picture was found by playing with manipulate and testing different color palettes. Use a small value of "MaxCurvature" when exploring and a bigger one when rendering (menu nb in the manipulate UI):

In[20]:=
Manipulate[
 ResourceFunction["SchmidtArrangements"][pre, "MinCurvature" -> 0, "MaxCurvature" -> nb, "Color" -> ColorData[s], "Transparency" -> "Increasing",
  "Filter" -> Rectangle[{-0.1, -0.1}, {1.1, 1.1}], PlotRange -> {{-0.1, 1}, {0, 1.0}}, ImageSize -> Large, Background -> Black],
 {s, ColorData["Gradients"]}, {{nb, 10}, {10, 20, 30, 40}}
 ]
Out[20]=

Publisher

Christophe Favergeon

Version History

  • 1.0.0 – 26 May 2021

Source Metadata

Related Resources

License Information