Project: s41467-025-61475-w | Function: update_beta1 (python)

system: You are an expert Python programmer implementing algorithms from scientific papers.
Complete the masked function based on the algorithm description.
Follow Python best practices and maintain consistent code style.
Return **only** the complete Python function code.

user: Complete this Python function:

**DESCRIPTION:** Implements the state-dependent effective inverse temperature β'(x) for curved neural networks. This function dynamically adjusts the temperature based on the current state overlap, creating self-regulating annealing dynamics.

**KEY TERMS:** {
  "beta": "inverse temperature β",
  "gamma": "curvature parameter γ",
  "overlap": "energy component based on state overlap",
  "size": "system size normalization"
}

**CONTEXT CODE:** """
GPLv3 2025 Miguel Aguilera
Clean version for unit testing - only function definitions with masks
"""

import numpy as np
from numba import njit

# Configure matplotlib (LaTeX disabled for testing)
import matplotlib
matplotlib.use('Agg')  # Use non-interactive backend

# ======================
#  Glauber Algorithm Functions
# ======================

@njit
def exp_g(x, gamma1):
    """Computes an exponential function with synaptic scaling correction."""
    return np.exp((1 / gamma1) * np.log(1 + gamma1 / 1 * x))


@njit
def update_beta1(xi, s, gamma, beta):
    """Dynamically updates the inverse temperature (beta) based on overlap."""
    raise NotImplementedError("Function implementation has been masked")


@njit
def SequentialGlauberStep(s, H, J, beta, gamma, xi, T):
    """
    Performs T steps of the Glauber algorithm, updating spins sequentially.
    
    Parameters:
    - s: Spin configuration
    - H: External field (zero in this case)
    - J: Interaction matrix (Hebbian)
    - beta: Inverse temperature
    - gamma: Synaptic scaling
    - xi: Stored patterns
    - T: Number of Glauber updates
    """
    raise NotImplementedError("Function implementation has been masked")

Complete the function implementation replacing "raise NotImplementedError".