Skip to main content

iwasawa_log

Function iwasawa_log 

Source
pub fn iwasawa_log<Q>(x: Q, precision: usize) -> AdicResult<QAdic<ZAdic>>
where Q: Into<QAdic<ZAdic>>,
Expand description

Iwasawa’s p-adic Log analogue for all x in Q_p.

Wikipedia

The normal series for ln(x) converges for x in Z_p^x, i.e. |x|_p < 1. With Iwasawa’s choice of Log(p) = 0, we can extend to all x in Q_p. We can use the Log identity Log(xy) = Log(x) + Log(y) to see for any x in Q_p, Log(x) is determined entirely by its unit. So here we calculate Log(x.unit()) and obtain a series that converges for all Q_p. See (Robert, p. 260) for the definition of Log(x).

assert_eq!(iwasawa_log(UAdic::new(5, vec![1]), 6)?.to_string(), "...000000._5");
assert_eq!(iwasawa_log(UAdic::new(5, vec![2]), 6)?.to_string(), "...042320._5");
assert_eq!(iwasawa_log(UAdic::new(5, vec![0, 1]), 6)?.to_string(), "...000000._5");
let log_three = iwasawa_log(UAdic::new(5, vec![3]), 6)?;
let log_nine = iwasawa_log(UAdic::new(5, vec![4, 1]), 6)?;
assert_eq!(log_nine, log_three.clone() + log_three.clone());
let error = AdicError::IllDefined("Log of zero undefined".to_string());
assert_eq!(Err(error), iwasawa_log(UAdic::new(5, vec![]), 6));