# Quantity System Types Architecture

Today I am going to talk about the types that the Quantity System contains in its runtime

I should make a distinction between two labels now:

- Quantity System Framework: is the library responsible about Quantities and their units. It forms the required functionality that holds the necessary classes for embedding units and quantities in your application.
- Quantity System: is the runtime that is built over the framework, that is evolving with time and its main concern is a new vision to apply the mathematics as a unit aware expressions.

I admit that I am learning mathematics again while programming this marvelous library, I learnt the compiler theory, parsing techniques, object oriented, and how can I apply it to physical applications.

I will try also to shorten my posts and increasing them to indicate the features that I’ve implemented so far. Also you (Dear reader) may encounter a lot of my thinking during the writings in this blog.

However let’s avoid my philosophy view of what I am doing and dive directly into the architecture.

# Qs Types

There is a complex type that called QsScalar which serve the basic calculation type in Qs.

The architecture of types that is calculated is illustrated on the next diagram

**Figure 1: Logical Relation between Qs Scalar and Tensor
**

## QsScalar

The scalar in quantity is a single quantity that holds a defined set of fields beside the unit of that field.

### Field

The field is simply a Ring (Mathematical Point of View) or (Entity if I am talking from a programmer point of view)

Integer Numbers are a field, Real Numbers are a field, Rational Numbers are a field, Irrational Numbers are fields also.

But the concept of field goes beyond these samples also, because you can find Functions as Field.

The following diagram will illustrate the Scalar Object supported fields in Quantity System

**Figure 2: Supported Mathematical Fields in QsScalar Type
**

#### Real Number

#### Rational Number

Which contains {Numerator, Denominator}

#### Complex Number

Which contains 2 components {Real Value, Imaginary Value}

#### Quaternions

Which contains 4 compnents {Real, i, j, k}

#### Symbolic

Symbolic variables that help in symbolic calculations

#### Functions

Referring to the function as a single quantity that can be added or subtracted

As I promised that’s all for now J

In the next posts, I will talk about the rest functionalities of Quantity System. So be tuned J