curl --request POST \
--url https://api.fincept.in/quantlib/physics/ising \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"size": 20,
"J": 1,
"h": 0,
"temperature": 1.5,
"n_steps": 5000,
"seed": 42
}
'{
"success": true,
"data": {
"energy": -756,
"magnetization": 0.842,
"size": 20,
"temperature": 1.5
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Simulate Ising Model
Simulates a 2D Ising model using Metropolis-Hastings Monte Carlo sampling. The Ising model describes interacting binary spins and exhibits phase transitions, making it useful for modeling collective behavior in financial systems, agent-based models, correlation structure, and systemic risk. Returns energy and magnetization of equilibrium configuration.
Use Cases:
- Model herd behavior and market sentiment cascades
- Study phase transitions in financial crises
- Analyze correlation breakdown during stress
- Agent-based market simulations
- Systemic risk and contagion modeling
Formula: E = -J Σ s_i s_j - h Σ s_i (spins s_i = ±1)
Credits: 5 credits per request (Pro Tier) [Tier: ENTERPRISE, Credits: 10]
curl --request POST \
--url https://api.fincept.in/quantlib/physics/ising \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"size": 20,
"J": 1,
"h": 0,
"temperature": 1.5,
"n_steps": 5000,
"seed": 42
}
'{
"success": true,
"data": {
"energy": -756,
"magnetization": 0.842,
"size": 20,
"temperature": 1.5
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
Grid size (creates size × size lattice)
20
Coupling constant (J>0: ferromagnetic/positive correlation, J<0: antiferromagnetic)
1
External field (bias toward +1 or -1 spins)
0
Temperature (T<Tc: ordered phase, T>Tc: disordered phase, Tc≈2.27 for J=1)
2.5
Number of Monte Carlo steps for equilibration
5000
Random seed for reproducibility (optional)
42
