# complex numbers

Published articles for complex numbers.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## MLIR -- Canonicalizers and Declarative Rewrite Patterns

DevFeed: [MLIR -- Canonicalizers and Declarative Rewrite Patterns](<https://devfeed.tech/articles/mlir-canonicalizers-and-declarative-rewrite-patterns-40477.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/20/mlir-canonicalizers-and-declarative-rewrite-patterns/>)

Published: 2023-09-20T08:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [canonicalization](<https://devfeed.tech/tags/canonicalization.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [tablegen](<https://devfeed.tech/tags/tablegen.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

This tutorial explains how to implement general canonicalization patterns in MLIR. It covers both C++ canonicalizers and declarative rewrite rules in TableGen, including an identity-based polynomial rewrite and its testing considerations.

### Source excerpt

Table of Contents In a previous article we defined folding functions, and used them to enable some canonicalization and the sccp constant propagation pass for the poly dialect. This time we'll see how to add more general canonicalization patterns. The code for this article is in this pull request, and as usual the commits are organized to be read in order. Why is Canonicalization Needed? MLIR provides folding as a mechanism to simplify an IR, which can result in simpler, more efficient ops (e.

## Encoding Schemes in FHE

DevFeed: [Encoding Schemes in FHE](<https://devfeed.tech/articles/encoding-schemes-in-fhe-40476.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/18/encoding-schemes-in-fhe/>)

Published: 2023-09-18T11:08:39Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Encoding](<https://devfeed.tech/topics/encoding.md>), [FHE](<https://devfeed.tech/topics/fhe.md>), [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [Decoding](<https://devfeed.tech/topics/decoding.md>)

Tags: [bits](<https://devfeed.tech/tags/bits.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [learning-with-errors](<https://devfeed.tech/tags/learning-with-errors.md>), [lwe](<https://devfeed.tech/tags/lwe.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [number-theory](<https://devfeed.tech/tags/number-theory.md>), [programming](<https://devfeed.tech/tags/programming.md>), [residue-number-system](<https://devfeed.tech/tags/residue-number-system.md>), [rlwe](<https://devfeed.tech/tags/rlwe.md>), [scaling](<https://devfeed.tech/tags/scaling.md>), [scheme](<https://devfeed.tech/tags/scheme.md>)

### AI overview

This article explains how cleartexts are transformed into plaintexts through encoding, and reversed through decoding, in homomorphic encryption. It catalogs encoding approaches for different HE schemes, including bit-field encoding for LWE and considerations for noise, scaling, bit positions, and programmable bootstrapping in CGGI/TFHE.

### Source excerpt

In cryptography, we need a distinction between a cleartext and a plaintext. A cleartext is a message in its natural form. A plaintext is a cleartext that is represented in a specific way to prepare it for encryption in a specific scheme. The process of taking a cleartext and turning it into a plaintext is called encoding, and the reverse is called decoding. In homomorphic encryption, the distinction matters. Cleartexts are generally all integers, though the bit width of allowed integers can be restricted (e.

## Operator overloading in Kotlin

DevFeed: [Operator overloading in Kotlin](<https://devfeed.tech/articles/operator-overloading-in-kotlin-39338.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-operators>)

Published: 2023-01-23T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>), [class](<https://devfeed.tech/topics/class.md>), [function](<https://devfeed.tech/topics/function.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [function](<https://devfeed.tech/tags/function.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [number](<https://devfeed.tech/tags/number.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [operations](<https://devfeed.tech/tags/operations.md>), [operator-overloading](<https://devfeed.tech/tags/operator-overloading.md>), [physics](<https://devfeed.tech/tags/physics.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A tutorial on Kotlin operator overloading. It explains Kotlin's predefined operators, how operator methods are declared for custom classes, and how arithmetic and range operators are handled, using complex numbers as an example.

### Source excerpt

How are operators defined for types in Kotlin, and how can we define our own operators.

## The Quantum Bit

DevFeed: [The Quantum Bit](<https://devfeed.tech/articles/the-quantum-bit-40373.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/12/15/the-quantum-bit/>)

Published: 2014-12-15T10:00:52Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Quantum Computing](<https://devfeed.tech/topics/quantum-computing.md>), [Computing](<https://devfeed.tech/topics/computing.md>), [circuit](<https://devfeed.tech/topics/circuit.md>)

Tags: [bits](<https://devfeed.tech/tags/bits.md>), [circuit](<https://devfeed.tech/tags/circuit.md>), [circuits](<https://devfeed.tech/tags/circuits.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [computing](<https://devfeed.tech/tags/computing.md>), [linear-algebra](<https://devfeed.tech/tags/linear-algebra.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [quantum](<https://devfeed.tech/tags/quantum.md>), [quantum-computing](<https://devfeed.tech/tags/quantum-computing.md>), [quantum-mechanics](<https://devfeed.tech/tags/quantum-mechanics.md>), [qubit](<https://devfeed.tech/tags/qubit.md>), [unitary-matrices](<https://devfeed.tech/tags/unitary-matrices.md>)

### AI overview

An introduction to quantum computing that extends classical circuit concepts to qubits. It defines a qubit as a unit vector in the complex plane of two dimensions and explains why extracting information from qubits differs from reading classical bits.

### Source excerpt

The best place to start our journey through quantum computing is to recall how classical computing works and try to extend it. Since our final quantum computing model will be a circuit model, we should informally discuss circuits first. A circuit has three parts: the "inputs," which are bits (either zero or one); the "gates," which represent the lowest-level computations we perform on bits; and the "wires," which connect the outputs of gates to the inputs of other gates.

## Learning to Love Complex Numbers

DevFeed: [Learning to Love Complex Numbers](<https://devfeed.tech/articles/learning-to-love-complex-numbers-40358.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/05/26/learning-to-love-complex-numbers/>)

Published: 2014-05-26T09:00:48Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Learning](<https://devfeed.tech/topics/learning.md>)

Tags: [complex](<https://devfeed.tech/tags/complex.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [fractals](<https://devfeed.tech/tags/fractals.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [learning](<https://devfeed.tech/tags/learning.md>), [mandelbrot-set](<https://devfeed.tech/tags/mandelbrot-set.md>), [python](<https://devfeed.tech/tags/python.md>), [trigonometry](<https://devfeed.tech/tags/trigonometry.md>)

### AI overview

An introductory post for readers with some programming experience and no prior mathematical background. It explains numbers as human-invented mathematical concepts and begins approaching complex numbers through the development of zero, negative numbers, fractions, square roots, and patterns in perfect squares.

### Source excerpt

This post is intended for people with a little bit of programming experience and no prior mathematical background. So let's talk about numbers. Numbers are curious things. On one hand, they represent one of the most natural things known to humans, which is quantity. It's so natural to humans that even newborn babies are in tune with the difference between quantities of objects between 1 and 3, in that they notice when quantity changes much more vividly than other features like color or shape.

## (Finite) Fields -- A Primer

DevFeed: [(Finite) Fields -- A Primer](<https://devfeed.tech/articles/finite-fields-a-primer-40348.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/02/26/finite-fields-a-primer/>)

Published: 2014-02-26T10:00:01Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>)

Tags: [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [euclidean-domains](<https://devfeed.tech/tags/euclidean-domains.md>), [field](<https://devfeed.tech/tags/field.md>), [field-characteristic](<https://devfeed.tech/tags/field-characteristic.md>), [finite-fields](<https://devfeed.tech/tags/finite-fields.md>), [groups](<https://devfeed.tech/tags/groups.md>), [ideals](<https://devfeed.tech/tags/ideals.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [monoids](<https://devfeed.tech/tags/monoids.md>), [operations](<https://devfeed.tech/tags/operations.md>), [polynomial-ring](<https://devfeed.tech/tags/polynomial-ring.md>), [vector-spaces](<https://devfeed.tech/tags/vector-spaces.md>)

### AI overview

This primer introduces fields as commutative rings with 0 and 1 in which every nonzero element has a multiplicative inverse. It defines the field axioms, places fields within related algebraic structures, and raises the question of finite fields.

### Source excerpt

So far on this blog we've given some introductory notes on a few kinds of algebraic structures in mathematics (most notably groups and rings, but also monoids). Fields are the next natural step in the progression. If the reader is comfortable with rings, then a field is extremely simple to describe: they're just commutative rings with 0 and 1, where every nonzero element has a multiplicative inverse. We'll give a list of all of the properties that go into this "simple" definition in a moment, but an even more simple way to describe a field is as a place where "arithmetic makes sense.

## Sums of k Powers

DevFeed: [Sums of k Powers](<https://devfeed.tech/articles/sums-of-k-powers-40216.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2011/07/01/sums-of-k-powers/>)

Published: 2011-07-01T12:52:29Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [polynomials](<https://devfeed.tech/topics/polynomials.md>), [context](<https://devfeed.tech/topics/context.md>)

Tags: [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [factoring](<https://devfeed.tech/tags/factoring.md>), [finite-fields](<https://devfeed.tech/tags/finite-fields.md>), [induction](<https://devfeed.tech/tags/induction.md>), [polynomial-ring](<https://devfeed.tech/tags/polynomial-ring.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>)

### AI overview

The article proves the geometric-series identity for sums of powers using base-k notation, polynomial factorization, and mathematical induction. It also explains extensions of the identity to fields such as the complex numbers and finite fields.

### Source excerpt

Problem: Prove that for all $ n,k \in \mathbb{N}, k > 1$, we have $$\sum \limits_{i=0}^{n} k^i = \frac{k^{n+1}-1}{k-1}$$ Solution: Representing the numbers in base $ k$, we have that each term of the sum is all 0's except for a 1 in the $ i$th place. Hence, the sum of all terms is the $ n$-digit number comprised of all 1's. Multiplying by $ k-1$ gives us the $ n$-digit number where every digit is $ k-1$.