Skip to main content

C++ SDK

Header-based C++ implementation of HulyaSync for high-performance and embedded applications. For operator computation, call the Zeq OS REST API.

Installation

cp -r zeq-os-hub/sdk/cpp/include/ your-project/include/
# or as a submodule
git submodule add https://github.com/hulyasmath/zeq-os.git vendor/zeq-os

Quick Start

#include <zeqos/sync.hpp>
#include <zeqos/constants.hpp>
#include <iostream>
#include <cmath>
#include <ctime>

int main() {
using namespace zeqos;

// ── Local temporal sync (no server, no auth) ───────────────────────────
double t = static_cast<double>(std::time(nullptr));
double phase = std::fmod(t, ZEQOND_PERIOD) / ZEQOND_PERIOD;

// Zeq Equation modulation: R(t) = S(t) × [1 + α·sin(2πft)]
double g_standard = 9.80665;
double g_modulated = g_standard * (1.0 + ALPHA * std::sin(2 * M_PI * HULYA_FREQUENCY * t));
std::cout << "Phase: " << phase << "\n";
std::cout << "g modulated: " << g_modulated << "\n";

// KO42 Metric Tensioner: α × sin(2π × 1.287 × t)
double ko42 = ALPHA * std::sin(2 * M_PI * HULYA_FREQUENCY * t);
std::cout << "KO42 = " << ko42 << "\n";

// Zeqond count since Unix epoch
long long zeqonds = static_cast<long long>(t / ZEQOND_PERIOD);
std::cout << "Zeqonds: " << zeqonds << "\n";

// ── REST API calls for computation (use libcurl or similar) ────────────
// See examples/api_client.cpp in the SDK for a full libcurl integration.
//
// Browse operators (no auth):
// GET http://localhost/api/zeq/operators
//
// Execute operator (requires Bearer token):
// POST http://localhost/api/zeq/operators/execute?operator=NM21
// Authorization: Bearer <token>
// { "params": { "G": 6.674e-11, "m1": 5.97e24, "m2": 7.35e22, "r": 3.84e8 } }

return 0;
}

Constants

namespace zeqos {
constexpr double HULYA_FREQUENCY = 1.287; // Hz
constexpr double ZEQOND_PERIOD = 0.777; // seconds
constexpr double ALPHA = 0.00129; // modulation depth
constexpr double PRECISION_TARGET = 0.001; // ≤ 0.1% mean error

// CODATA 2022
constexpr double G = 6.67430e-11; // m³ kg⁻¹ s⁻²
constexpr double C = 299792458.0; // m/s
constexpr double H_BAR = 1.054571817e-34; // J·s
constexpr double K_B = 1.380649e-23; // J/K
}

HulyaSync Header

namespace zeqos {

class HulyaSync {
public:
HulyaSync();

double current_phase() const; // [0, 1)
double current_phase_rad() const; // [0, 2π)
double modulate(double value) const; // R(t) = S(t)[1 + α·sin(2πft)]
double ko42_automatic() const; // α · sin(2π × 1.287 × t)
long long get_zeqond() const; // Zeqond count since epoch
std::string daemon_tick() const; // Daemon announcement
};

} // namespace zeqos

Framework Equations

Zeq Equation:   R(t) = S(t) × [1 + α × sin(2π × 1.287 × t)]
KO42: α × sin(2π × 1.287 × t)
HULYAS: □(φ) − μ²(r)φ − λφ³ − exp(−φ/φ_c) + φ₄₂ × Σ(Cₖ(φ)) = T^μ_μ + βF·F + J_ext

Use Cases

  • Real-time physics engines — sub-millisecond HulyaPulse synchronization
  • Embedded systems — KO42 metric tensioner on hardware
  • Signal processing — temporal alignment at 1.287 Hz
  • Game engines — phase-coherent physics simulation

Build

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make

Architecture

sdk/cpp/
├── CMakeLists.txt
├── include/zeqos/
│ ├── constants.hpp # Physical constants
│ ├── sync.hpp # HulyaSync
│ └── operators.hpp # Operator interfaces
├── src/
└── examples/
├── basic_sync.cpp
└── api_client.cpp # libcurl REST integration