Everything is a vector now: a NumPy afternoon from molecule fields to your detail library
A hands-on NumPy tutorial for architects: build vectors, compute cosine similarity, and turn a messy detail folder into a searchable library this afternoon.
Start at the frontier, because that is where the idea is cleanest. A paper heading to ICML 2026 — VecMol, by Yuchen Hua, Xingang Peng, Jianzhu Ma and Muhan Zhang, summarised on Lacuna — stops treating a molecule as a bag of atoms with x, y, z coordinates and instead represents it as a continuous vector field. The point that matters for us is not the chemistry. It is that a group of researchers looked at the hardest representation problem in their field and answered it the same way everyone else does: turn the thing into vectors, then do maths.
That is the whole trick of modern machine learning, and it is quietly the same trick your BIM tools are about to run on your detail library. A vector is not exotic. As the GeeksforGeeks primer on vectors for ML puts it plainly, it is just “an ordered list of numbers, where each number represents a feature.” A person is [170, 65]. A wall detail is a longer list. A whole IFC element description, once embedded, is a list of a few hundred floats. Learn to build and compare those lists and you have the primitive under embeddings, retrieval, similarity search, and every RAG pipeline your office is about to buy without reading the manual.
The Tool: NumPy
The Tool: NumPy, the numerical-array library that Travis Oliphant first shipped in 2006 by fusing the older Numeric and Numarray projects, now maintained by a large open community. It is worth a computational designer’s afternoon because it is the layer everything else stands on — PyTorch, scikit-learn, every embedding call you make — and because a NumPy vector is small enough to actually understand. You can hold the whole mental model in your head, which is more than most of the stack lets you do.
Setup
python -m venv .venv
.venv\Scripts\activate # Windows; on macOS/Linux: source .venv/bin/activate
pip install numpy
python -c "import numpy as np; print('person vector:', np.array([170, 65]))"
# person vector: [170 65]First steps
First steps:
- Save a file
vectors.pyand build two feature vectors:a = np.array([2, 3])andb = np.array([1, 4]). Printa + bandnp.dot(a, b)— addition combines features, the dot product collapses them to one number that measures agreement. - Change one number in
aand re-run. Watch the dot product move. That single scalar is what a linear-regression weight, an SVM margin, and a neural-net activation are all quietly computing. - Stack vectors into a matrix (
np.array([[1,2,3],[4,5,6]])) and you have a whole dataset — rows are data points, columns are features. This is the shape every model eats.
←TODAY: In 2026 a molecule, a sentence, and a facade detail are all stored as the same thing — a list of floats — and NumPy is the ruler that measures the distance between them. →3012: The offices whose knowledge survives are the ones that kept the raw text and could recompute the vectors when the embedding vendor went dark. Fulcrum: A vector is portable in a way a proprietary object never was — which is exactly why it is worth learning the maths and not just the button.
Why direction beats distance
The moment vectors earn their keep on a real desk is search. You have a detail on screen and 4,000 others in a shared folder nobody has tidied since the last office merger. You do not want the one with the same magnitude; you want the one pointing the same way. That is cosine similarity — the cosine of the angle between two vectors — and the GeeksforGeeks piece lists it beside Euclidean distance for a reason: they answer different questions. Euclidean asks “how far apart,” cosine asks “how aligned.” For text and embeddings, alignment usually wins.
Here is the honest trade-off, stated plainly: cosine similarity throws away magnitude on purpose. Two details can score a perfect 1.0 and be built at different scales, because the metric only sees direction. The metric you pick decides what “similar” means, and picking it badly is how a search that feels smart returns confidently wrong neighbours.
That failure has a name in PAZ’s own reference material. Our concept note on Context Window Scaling puts it bluntly: the scaling law for retrieval “is about curation, not stuffing” — pass ten useful chunks, not two hundred merely similar ones. Same warning, one abstraction up. A good similarity score is a nomination, not a decision.
Atelier: For a Swiss Büro standardising on Rhino and Grasshopper — PAZ Academy has taught Grasshopper 2 since its Alpha and resells the Rhino 8 + WIP licences the office runs it on — the reach for vectors is not abstract. Your Grasshopper canvas already speaks this language natively as Vector3d in C# and RhinoCommon; embeddings just extend the same idea from geometry to text and IFC metadata. The Monday move: pick your ten most-reused wall or slab details, embed their short text descriptions with any local model, and stand up a 30-line NumPy cosine-search script your team can query instead of scrolling the folder. Ship it ugly; measure whether it saves the four hours it should.
Hack: Rank a messy detail library by how closely each entry aligns with the one on your screen. Cosine similarity is the whole move — dot product over the product of the magnitudes — and it is the same three lines whether the vectors describe molecules, sentences, or slab edges. Swap the toy arrays below for real embeddings and it scales unchanged.
import numpy as np
def cosine(a, b):
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
target = np.array([0.8, 0.1, 0.3]) # the detail you have
library = np.array([[0.7, 0.2, 0.4], [0.1, 0.9, 0.0]]) # the folder
print([round(cosine(target, row), 3) for row in library])
# [0.973, 0.257] -> row 0 is your matchThe generation writing from the far side of this remembers one lesson worth packing: a vector is only as durable as your ability to recompute it. Store the raw text and the model name alongside the floats. When the embedding vendor disappears — and one always does — you regenerate the library instead of losing it. That is Momo’s format-longevity rule in a new coat: ask whether a 25-year-old could rebuild this from what you kept.
Learn-it
- Tutorial (the source we built on): GeeksforGeeks — Vectors for ML
- Frontier read: VecMol — Vector-Field Representations for 3D Molecule Generation (ICML 2026)
- Root concept: What is a foundation model? — where these vectors get big enough to hallucinate.
- PAZ note: Bring your ten reused details to a Grasshopper session —
Vector3din C# and a NumPy cosine script are the same idea; the PAZ Grasshopper↔Archicad Library is where we wire it into practice.
SOURCE · ↗
PAZ Kaffi · multidisciplinary editorial, led by PAZ Academy