{"record":{"id":"0ab00b6b15a022d8","repo":"ruvnet/ruflo","slug":"conformal-factor-is-only-defined-for-poincare-ball","errorCode":null,"errorMessage":"Conformal factor is only defined for Poincare ball model","messagePattern":"Conformal factor is only defined for Poincare ball model","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugins/src/integrations/ruvector/hyperbolic.ts","lineNumber":1124,"sourceCode":"   * @returns Point on geodesic\n   */\n  geodesic(a: number[], b: number[], t: number): number[] {\n    const tangent = this.logMap(a, b);\n    const scaledTangent = scale(tangent, t);\n    return this.expMap(a, scaledTangent);\n  }\n\n  /**\n   * Computes the conformal factor (lambda) at a point in Poincare ball.\n   *\n   * lambda_p = 2 / (1 - |c| * ||p||^2)\n   *\n   * @param point - Point in Poincare ball\n   * @returns Conformal factor\n   */\n  conformalFactor(point: number[]): number {\n    if (this.model !== 'poincare') {\n      throw new Error('Conformal factor is only defined for Poincare ball model');\n    }\n    const c = Math.abs(this._curvature);\n    const pSq = normSquared(point);\n    return 2 / Math.max(1 - c * pSq, this.eps);\n  }\n}\n\n// ============================================================================\n// SQL Generation for RuVector PostgreSQL Functions\n// ============================================================================\n\n/**\n * SQL function call builder for RuVector hyperbolic operations.\n */\nexport class HyperbolicSQL {\n  /**\n   * Generates SQL for Poincare distance computation.\n   *","sourceCodeStart":1106,"sourceCodeEnd":1142,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugins/src/integrations/ruvector/hyperbolic.ts#L1106-L1142","documentation":"HyperbolicSpace.conformalFactor() (hyperbolic.ts:1124) computes lambda_p = 2 / (1 - |c|*||p||^2), the conformal scaling factor that exists only for the conformal (angle-preserving) Poincare ball model. Lorentz, Klein, and half-space models are not conformal in this parametrization, so calling the method on any of them throws immediately.","triggerScenarios":"Constructing HyperbolicSpace with 'lorentz' or 'klein' and calling conformalFactor(point); generic metric code that enumerates all space methods regardless of model; porting Poincare-specific training tricks (conformal-factor-weighted gradients) to another model.","commonSituations":"Switching the embedding model for numerical-stability reasons while keeping Poincare-specific optimizer code; shared utility functions invoked across spaces built with different models.","solutions":["Use a Poincare space ('poincare') when you need conformal geometry","Branch on space model before calling: only call conformalFactor when model === 'poincare'","For Lorentz pipelines, replace conformal scaling with the Lorentzian norm-based weighting appropriate to that model"],"exampleFix":"// before\nconst space = new HyperbolicSpace('lorentz', -1);\nconst lambda = space.conformalFactor(p); // throws\n\n// after\nconst space = new HyperbolicSpace('lorentz', -1);\nconst lambda = space.model === 'poincare' ? space.conformalFactor(p) : 1; // identity scaling for non-conformal models","handlingStrategy":"validation","validationCode":"const lambda = space.model === 'poincare' ? space.conformalFactor(p) : 1; // identity for non-conformal models","typeGuard":"function isPoincareSpace(space: HyperbolicSpace): boolean {\n  return space.model === 'poincare';\n}","tryCatchPattern":"try {\n  lambda = space.conformalFactor(p);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Conformal factor')) {\n    lambda = 1; // not defined for this model; skip conformal scaling\n  } else throw err;\n}","preventionTips":["Branch on space.model before calling Poincare-only methods","Keep Poincare-specific optimizer tricks in code paths that construct 'poincare' spaces","Document which geometry each utility requires when sharing helpers across models"],"tags":["hyperbolic-geometry","unsupported-operation","model-mismatch"],"backgroundTag":"unsupported-operation-mode","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}