/**
 * @brief Functions used throughout the package
 *
 * @author Yunhai Li (liyunhai1016@hotmail.com)
 *
 * @copyright Copyright (c) 2024, TBPLaS develop team.
 */

#ifndef TBPLAS_BASE_FUNCS_H
#define TBPLAS_BASE_FUNCS_H

#include "datatypes.h"

namespace tbplas::base {

/**
 * @brief Common interface to take the conjugate of real/complex number
 *
 * @param[in] t incoming number
 * @return conjugate counterpart of the number
 */
double conj_t(const double& t);

/**
 * @brief Common interface to take the conjugate of real/complex number
 *
 * @param[in] t incoming number
 * @return conjugate counterpart of the number
 */
complex_t conj_t(const complex_t& t);

/**
 * @brief Common interface to take the real part of real/complex number
 *
 * @param[in] t incoming number
 * @return real part of the number
 */
double real_part(const double& t);

/**
 * @brief Common interface to take the real part of real/complex number
 *
 * @param[in] t incoming number
 * @return real part of the number
 */
double real_part(const complex_t& t);

/**
 * @brief Common interface to take the imaginary part of real/complex number
 *
 * @param[in] t incoming number
 * @return imaginary part of the number
 */
double imag_part(const double& t);

/**
 * @brief Common interface to take the imaginary part of real/complex number
 *
 * @param[in] t incoming number
 * @return imaginary part of the number
 */
double imag_part(const complex_t& t);

/**
 * @brief Evaluate exp(i*t) using Euler's formula
 *
 * @param[in] t the argument
 * @return complex number exp(i*t)
 */
complex_t exp_it(const double& t);

} // namespace tbplas::base

#endif